Skip to content

Commit

Permalink
Fixing test with afterRender
Browse files Browse the repository at this point in the history
  • Loading branch information
rdamazio committed Apr 23, 2024
1 parent f392766 commit a0084ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/model/storage/checklist-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ export class ChecklistStorage {

constructor() {
afterNextRender(() => {
this._browserStorage = localStorage;
}, {phase: AfterRenderPhase.Read});
this.onAfterRender();
}, {phase: AfterRenderPhase.Read});
}

onAfterRender() {
this._browserStorage = localStorage;
}

listChecklistFiles(): string[] {
Expand All @@ -36,6 +40,7 @@ export class ChecklistStorage {
if (blob) {
return ChecklistFile.fromJsonString(blob);
}

}
return null;
}
Expand Down
1 change: 1 addition & 0 deletions src/model/storage/checklists-storage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('ChecklistsService', () => {
beforeEach(() => {
TestBed.configureTestingModule({});
store = TestBed.inject(ChecklistStorage);
store.onAfterRender();
store.clear();
});

Expand Down

0 comments on commit a0084ab

Please sign in to comment.