From c21096a49a8a67a77173daf3e352a5ba5f39c315 Mon Sep 17 00:00:00 2001 From: Joery Date: Tue, 23 Apr 2024 16:00:38 +0200 Subject: [PATCH] ci: Added test for project updating --- .../test/Storage/indexedDB/Project.spec.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/shared/test/Storage/indexedDB/Project.spec.ts b/packages/shared/test/Storage/indexedDB/Project.spec.ts index 5b9ae38f..298b4219 100644 --- a/packages/shared/test/Storage/indexedDB/Project.spec.ts +++ b/packages/shared/test/Storage/indexedDB/Project.spec.ts @@ -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'); +});