Skip to content

Commit

Permalink
ci: Added test for project updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Joery committed Apr 23, 2024
1 parent ef13df3 commit c21096a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/shared/test/Storage/indexedDB/Project.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,23 @@ test('Retrieve project', async () => {

expect(loadedProject?.id).toEqual(project.id);
});

test('Update project', async () => {
const storage = new IndexedDbStorageController();

const project = new SimpleProject();
project.name.value = 'Name 1';

await storage.SaveProject(project);

project.name.value = 'Name 2';

Storage.setStorage(storage);

const res = await project.Save();
expect(res).toEqual('Success');

const loadedProject = await storage.LoadProject(project.id);
expect(loadedProject).toBeDefined();
expect(loadedProject?.name.value).toBe('Name 2');
});

0 comments on commit c21096a

Please sign in to comment.