-
-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11486 from qmonmert/refactoduplication
Refacto: fakeStorage is duplicated
- Loading branch information
Showing
3 changed files
with
15 additions
and
28 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/test/webapp/unit/module/secondary/FakeStorage.fixture.ts
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,13 @@ | ||
export const fakeStorage = (): Storage => { | ||
let store: { [key: string]: string } = {}; | ||
return { | ||
getItem: (key: string) => store[key], | ||
setItem: (key: string, value: string) => (store[key] = value), | ||
removeItem: (key: string) => delete store[key], | ||
clear: () => (store = {}), | ||
get length() { | ||
return Object.keys(store).length; | ||
}, | ||
key: (index: number) => Object.keys(store)[index], | ||
}; | ||
}; |
15 changes: 1 addition & 14 deletions
15
src/test/webapp/unit/module/secondary/LocalStorageModuleParametersRepository.spec.ts
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
15 changes: 1 addition & 14 deletions
15
src/test/webapp/unit/module/secondary/LocalWindowThemeRepository.spec.ts
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