Skip to content

Commit

Permalink
add services to cipher form storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-livefront committed Dec 4, 2024
1 parent 3f6374f commit 7b12559
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion libs/vault/src/cipher-form/cipher-form.stories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { importProvidersFrom } from "@angular/core";
import { importProvidersFrom, signal } from "@angular/core";

Check warning on line 1 in libs/vault/src/cipher-form/cipher-form.stories.ts

View check run for this annotation

Codecov / codecov/patch

libs/vault/src/cipher-form/cipher-form.stories.ts#L1

Added line #L1 was not covered by tests
import { action } from "@storybook/addon-actions";
import {
applicationConfig,
Expand All @@ -10,6 +10,7 @@ import {
import { BehaviorSubject } from "rxjs";

import { CollectionView } from "@bitwarden/admin-console/common";
import { ViewCacheService } from "@bitwarden/angular/platform/abstractions/view-cache.service";

Check warning on line 13 in libs/vault/src/cipher-form/cipher-form.stories.ts

View check run for this annotation

Codecov / codecov/patch

libs/vault/src/cipher-form/cipher-form.stories.ts#L13

Added line #L13 was not covered by tests
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service";
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
Expand All @@ -18,6 +19,7 @@ import { AutofillSettingsServiceAbstraction } from "@bitwarden/common/autofill/s
import { DomainSettingsService } from "@bitwarden/common/autofill/services/domain-settings.service";
import { ClientType } from "@bitwarden/common/enums";
import { UriMatchStrategy } from "@bitwarden/common/models/domain/domain-service";
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";

Check warning on line 22 in libs/vault/src/cipher-form/cipher-form.stories.ts

View check run for this annotation

Codecov / codecov/patch

libs/vault/src/cipher-form/cipher-form.stories.ts#L22

Added line #L22 was not covered by tests
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { CipherType } from "@bitwarden/common/vault/enums";
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
Expand All @@ -38,6 +40,7 @@ import { CipherFormService } from "./abstractions/cipher-form.service";
import { TotpCaptureService } from "./abstractions/totp-capture.service";
import { CipherFormModule } from "./cipher-form.module";
import { CipherFormComponent } from "./components/cipher-form.component";
import { CipherFormCacheService } from "./services/default-cipher-form-cache.service";

Check warning on line 43 in libs/vault/src/cipher-form/cipher-form.stories.ts

View check run for this annotation

Codecov / codecov/patch

libs/vault/src/cipher-form/cipher-form.stories.ts#L43

Added line #L43 was not covered by tests

const defaultConfig: CipherFormConfig = {
mode: "add",
Expand Down Expand Up @@ -190,6 +193,25 @@ export default {
activeAccount$: new BehaviorSubject({ email: "[email protected]" }),
},
},
{
provide: CipherFormCacheService,
useValue: {
getCachedCipherView: (): null => null,

Check warning on line 199 in libs/vault/src/cipher-form/cipher-form.stories.ts

View check run for this annotation

Codecov / codecov/patch

libs/vault/src/cipher-form/cipher-form.stories.ts#L199

Added line #L199 was not covered by tests
initializedWithValue: false,
},
},
{
provide: ViewCacheService,
useValue: {
signal: () => signal(null),

Check warning on line 206 in libs/vault/src/cipher-form/cipher-form.stories.ts

View check run for this annotation

Codecov / codecov/patch

libs/vault/src/cipher-form/cipher-form.stories.ts#L206

Added line #L206 was not covered by tests
},
},
{
provide: ConfigService,
useValue: {
getFeatureFlag: () => Promise.resolve(false),

Check warning on line 212 in libs/vault/src/cipher-form/cipher-form.stories.ts

View check run for this annotation

Codecov / codecov/patch

libs/vault/src/cipher-form/cipher-form.stories.ts#L212

Added line #L212 was not covered by tests
},
},
],
}),
componentWrapperDecorator(
Expand Down

0 comments on commit 7b12559

Please sign in to comment.