-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separated tests for each package to have only darkroom use browser
- Loading branch information
Showing
13 changed files
with
144 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { IDBKeyRange, indexedDB } from 'fake-indexeddb'; | ||
import { expect, test } from 'vitest'; | ||
import SimpleProject from '../../../src/Project/SimpleProject'; | ||
import IndexedDbStorageController from '../../../src/Storage/IndexedDbStorage'; | ||
|
||
test('List projects', async () => { | ||
global.indexedDB = indexedDB; | ||
global.IDBKeyRange = IDBKeyRange; | ||
|
||
const storage = new IndexedDbStorageController(); | ||
|
||
const project = new SimpleProject(); | ||
await storage.SaveProject(project); | ||
|
||
const projects = await storage.getProjects(); | ||
|
||
expect(projects[0].id).toBe(project.id); | ||
}); | ||
|
||
test('Retrieve project', async () => { | ||
global.indexedDB = indexedDB; | ||
global.IDBKeyRange = IDBKeyRange; | ||
|
||
const storage = new IndexedDbStorageController(); | ||
|
||
const project = new SimpleProject(); | ||
await storage.SaveProject(project); | ||
|
||
const loadedProject = await storage.LoadProject(project.id); | ||
|
||
expect(loadedProject?.id).toEqual(project.id); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.