mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-22 21:21:35 +01:00
[Fix] Storybook: product navigation errors (#9664)
* fix product switcher stories by adding sync service mock * remove redundant await
This commit is contained in:
parent
dda17885f9
commit
90cdd9343b
@ -9,6 +9,7 @@ import { ProviderService } from "@bitwarden/common/admin-console/abstractions/pr
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { Provider } from "@bitwarden/common/admin-console/models/domain/provider";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { SyncService } from "@bitwarden/common/platform/sync";
|
||||
import { LayoutComponent, NavigationModule } from "@bitwarden/components";
|
||||
import { I18nMockService } from "@bitwarden/components/src/utils/i18n-mock.service";
|
||||
|
||||
@ -45,6 +46,12 @@ class MockProviderService implements Partial<ProviderService> {
|
||||
}
|
||||
}
|
||||
|
||||
class MockSyncService implements Partial<SyncService> {
|
||||
async getLastSync() {
|
||||
return Promise.resolve(new Date());
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: "story-layout",
|
||||
template: `<ng-content></ng-content>`,
|
||||
@ -80,6 +87,7 @@ export default {
|
||||
providers: [
|
||||
{ provide: OrganizationService, useClass: MockOrganizationService },
|
||||
{ provide: ProviderService, useClass: MockProviderService },
|
||||
{ provide: MockSyncService, useClass: MockSyncService },
|
||||
ProductSwitcherService,
|
||||
{
|
||||
provide: I18nPipe,
|
||||
|
@ -9,6 +9,7 @@ import { ProviderService } from "@bitwarden/common/admin-console/abstractions/pr
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { Provider } from "@bitwarden/common/admin-console/models/domain/provider";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { SyncService } from "@bitwarden/common/platform/sync";
|
||||
import { IconButtonModule, LinkModule, MenuModule } from "@bitwarden/components";
|
||||
import { I18nMockService } from "@bitwarden/components/src/utils/i18n-mock.service";
|
||||
|
||||
@ -45,6 +46,12 @@ class MockProviderService implements Partial<ProviderService> {
|
||||
}
|
||||
}
|
||||
|
||||
class MockSyncService implements Partial<SyncService> {
|
||||
async getLastSync() {
|
||||
return Promise.resolve(new Date());
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: "story-layout",
|
||||
template: `<ng-content></ng-content>`,
|
||||
@ -75,6 +82,7 @@ export default {
|
||||
MockOrganizationService,
|
||||
{ provide: ProviderService, useClass: MockProviderService },
|
||||
MockProviderService,
|
||||
{ provide: SyncService, useClass: MockSyncService },
|
||||
ProductSwitcherService,
|
||||
{
|
||||
provide: I18nService,
|
||||
|
Loading…
Reference in New Issue
Block a user