Skip to content

Commit

Permalink
test: collection heap after upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: David Dal Busco <[email protected]>
  • Loading branch information
peterpeterparker committed Mar 15, 2024
1 parent ff1e8c2 commit 8c7d18f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/tests/satellite.upgrade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,32 @@ describe('satellite upgrade v0.0.16', () => {

await testUsers([...users, ...moreUsers]);
});

it('should keep listing existing heap collections as such', async () => {
const { set_rule, list_rules } = actor;

await set_rule({ Db: null }, 'test', {
memory: toNullable({ Heap: null }),
updated_at: toNullable(),
max_size: toNullable(),
read: { Managed: null },
mutable_permissions: toNullable(),
write: { Managed: null }
});

const testCollection = async () => {
const [[collection, { memory }], _] = await list_rules({
Db: null
});

expect(collection).toEqual('test');
expect(memory).toEqual(toNullable({ Heap: null }));
};

await testCollection();

await upgrade();

await testCollection();
});
});

0 comments on commit 8c7d18f

Please sign in to comment.