Skip to content

Commit 5a69150

Browse files
Revert "feat(cdn): comment description assertion until release (#1670)" (#1671)
* Revert "feat(cdn): comment description assertion until release (#1670)" This reverts commit c004dfb. * feat: redo import
1 parent a057da8 commit 5a69150

File tree

3 files changed

+17
-24
lines changed

3 files changed

+17
-24
lines changed

src/console/src/cdn/assert.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::cdn::constants::{RELEASES_COLLECTION_KEY, RELEASES_COLLECTION_PATH};
2+
use junobuild_cdn::storage::assert_releases_description;
23
use junobuild_cdn::storage::errors::{
34
JUNO_CDN_STORAGE_ERROR_INVALID_COLLECTION, JUNO_CDN_STORAGE_ERROR_INVALID_RELEASES_PATH,
45
};
@@ -9,14 +10,13 @@ use junobuild_storage::types::state::FullPath;
910

1011
pub fn assert_cdn_asset_keys(
1112
full_path: &FullPath,
12-
_description: &Option<String>,
13+
description: &Option<String>,
1314
collection: &CollectionKey,
1415
) -> Result<(), String> {
1516
match collection.as_str() {
1617
RELEASES_COLLECTION_KEY => {
1718
assert_releases_keys(full_path)?;
18-
// TODO: Uncomment for release
19-
// assert_releases_description(description)?;
19+
assert_releases_description(description)?;
2020

2121
Ok(())
2222
}

src/tests/specs/satellite/stock/satellite.cdn.spec.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ describe('Satellite > Cdn', () => {
3737

3838
const currentDate = new Date(2021, 6, 10, 0, 0, 0, 0);
3939

40-
// TODO: Redo 32n for release
41-
const EXPECTED_PROPOSALS_BASE_COUNT = 28n;
42-
4340
beforeAll(async () => {
4441
pic = await PocketIc.create(inject('PIC_URL'));
4542

@@ -329,7 +326,7 @@ describe('Satellite > Cdn', () => {
329326
canisterId: () => canisterId,
330327
caller: () => controllerSubmit,
331328
pic: () => pic,
332-
expected_proposal_id: EXPECTED_PROPOSALS_BASE_COUNT,
329+
expected_proposal_id: 32n,
333330
fullPaths: {
334331
assetsUpgrade: '/magic.html',
335332
segmentsDeployment: '/_juno/releases/satellite-v2.1.1.wasm.gz',
@@ -342,7 +339,7 @@ describe('Satellite > Cdn', () => {
342339
testCdnGetProposal({
343340
actor: () => actor,
344341
owner: () => controllerSubmit,
345-
proposalId: EXPECTED_PROPOSALS_BASE_COUNT
342+
proposalId: 32n
346343
});
347344

348345
testCdnGetProposal({
@@ -362,7 +359,7 @@ describe('Satellite > Cdn', () => {
362359
return actor;
363360
},
364361
owner: () => controllerSubmit,
365-
proposalId: EXPECTED_PROPOSALS_BASE_COUNT
362+
proposalId: 32n
366363
});
367364

368365
testCdnGetProposal({
@@ -371,7 +368,7 @@ describe('Satellite > Cdn', () => {
371368
return actor;
372369
},
373370
owner: () => controllerSubmit,
374-
proposalId: EXPECTED_PROPOSALS_BASE_COUNT
371+
proposalId: 32n
375372
});
376373
});
377374

@@ -390,7 +387,7 @@ describe('Satellite > Cdn', () => {
390387
canisterId: () => canisterId,
391388
caller: () => controllerSubmit,
392389
pic: () => pic,
393-
expected_proposal_id: EXPECTED_PROPOSALS_BASE_COUNT + 6n,
390+
expected_proposal_id: 38n,
394391
fullPaths: {
395392
assetsUpgrade: '/book.html',
396393
segmentsDeployment: '/_juno/releases/satellite-v3.1.1.wasm.gz',
@@ -403,7 +400,7 @@ describe('Satellite > Cdn', () => {
403400
testCdnGetProposal({
404401
actor: () => actor,
405402
owner: () => controllerSubmit,
406-
proposalId: EXPECTED_PROPOSALS_BASE_COUNT
403+
proposalId: 32n
407404
});
408405

409406
testCdnGetProposal({
@@ -423,7 +420,7 @@ describe('Satellite > Cdn', () => {
423420
return actor;
424421
},
425422
owner: () => controllerSubmit,
426-
proposalId: EXPECTED_PROPOSALS_BASE_COUNT
423+
proposalId: 32n
427424
});
428425

429426
testCdnGetProposal({
@@ -432,7 +429,7 @@ describe('Satellite > Cdn', () => {
432429
return actor;
433430
},
434431
owner: () => controllerSubmit,
435-
proposalId: EXPECTED_PROPOSALS_BASE_COUNT
432+
proposalId: 32n
436433
});
437434
});
438435

@@ -442,7 +439,7 @@ describe('Satellite > Cdn', () => {
442439
await expect(
443440
commit_proposal({
444441
sha256: Array.from({ length: 32 }).map((_, i) => i),
445-
proposal_id: EXPECTED_PROPOSALS_BASE_COUNT
442+
proposal_id: 32n
446443
})
447444
).rejects.toThrow(JUNO_AUTH_ERROR_NOT_WRITE_CONTROLLER);
448445
});
@@ -463,12 +460,12 @@ describe('Satellite > Cdn', () => {
463460

464461
testCdnListProposals({
465462
actor: () => actor,
466-
proposalsLength: EXPECTED_PROPOSALS_BASE_COUNT + 11n
463+
proposalsLength: 43n
467464
});
468465

469466
testCdnCountProposals({
470467
actor: () => actor,
471-
proposalsLength: EXPECTED_PROPOSALS_BASE_COUNT + 11n
468+
proposalsLength: 43n
472469
});
473470
});
474471
});

src/tests/utils/cdn-assertions-tests.utils.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,7 @@ export const testReleasesProposal = ({
848848
});
849849
});
850850

851-
// TODO: include for release
852-
describe.skip.each(validModuleFullPaths)('Asset requires description', (fullPath) => {
851+
describe.each(validModuleFullPaths)('Asset requires description', (fullPath) => {
853852
it('should throw error if description is missing', async () => {
854853
const { init_proposal_asset_upload, init_proposal } = actor();
855854

@@ -1044,12 +1043,9 @@ export const testCdnGetProposal = ({
10441043
});
10451044
};
10461045

1047-
// TODO: Redo 25n for release
1048-
const EXPECTED_PROPOSALS_BASE_COUNT = 19n;
1049-
10501046
export const testCdnCountProposals = ({
10511047
actor,
1052-
proposalsLength = EXPECTED_PROPOSALS_BASE_COUNT
1048+
proposalsLength = 25n
10531049
}: {
10541050
actor: () => Actor<SatelliteActor | ConsoleActor>;
10551051
proposalsLength?: bigint;
@@ -1063,7 +1059,7 @@ export const testCdnCountProposals = ({
10631059

10641060
export const testCdnListProposals = ({
10651061
actor,
1066-
proposalsLength = EXPECTED_PROPOSALS_BASE_COUNT
1062+
proposalsLength = 25n
10671063
}: {
10681064
actor: () => Actor<SatelliteActor | ConsoleActor>;
10691065
proposalsLength?: bigint;

0 commit comments

Comments
 (0)