Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton committed Jan 17, 2025
1 parent 5e4b53f commit 3db1bca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 9 additions & 6 deletions libs/components/src/copy-click/copy-click.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { ComponentFixture, TestBed } from "@angular/core/testing";

import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { ToastService } from "@bitwarden/components";

import { ToastService } from "../";

import { CopyClickDirective } from "./copy-click.directive";

Expand All @@ -20,12 +21,14 @@ import { CopyClickDirective } from "./copy-click.directive";
#toastWithLabel
></button>
`,
standalone: true,
imports: [CopyClickDirective],
})
class TestCopyClickComponent {
@ViewChild("noToast") noToastButton: ElementRef<HTMLButtonElement>;
@ViewChild("infoToast") infoToastButton: ElementRef<HTMLButtonElement>;
@ViewChild("successToast") successToastButton: ElementRef<HTMLButtonElement>;
@ViewChild("toastWithLabel") toastWithLabelButton: ElementRef<HTMLButtonElement>;
@ViewChild("noToast") noToastButton!: ElementRef<HTMLButtonElement>;
@ViewChild("infoToast") infoToastButton!: ElementRef<HTMLButtonElement>;
@ViewChild("successToast") successToastButton!: ElementRef<HTMLButtonElement>;
@ViewChild("toastWithLabel") toastWithLabelButton!: ElementRef<HTMLButtonElement>;
}

describe("CopyClickDirective", () => {
Expand All @@ -38,7 +41,7 @@ describe("CopyClickDirective", () => {
showToast.mockClear();

await TestBed.configureTestingModule({
declarations: [CopyClickDirective, TestCopyClickComponent],
imports: [TestCopyClickComponent],
providers: [
{
provide: I18nService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { By } from "@angular/platform-browser";
import { mock } from "jest-mock-extended";
import { BehaviorSubject } from "rxjs";

import { CopyClickDirective } from "@bitwarden/angular/directives/copy-click.directive";
import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions";
Expand All @@ -17,7 +16,7 @@ import { CipherType } from "@bitwarden/common/vault/enums";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { Fido2CredentialView } from "@bitwarden/common/vault/models/view/fido2-credential.view";
import { LoginView } from "@bitwarden/common/vault/models/view/login.view";
import { BitFormFieldComponent, ToastService } from "@bitwarden/components";
import { CopyClickDirective, BitFormFieldComponent, ToastService } from "@bitwarden/components";
// FIXME: remove `src` and fix import
// eslint-disable-next-line no-restricted-imports
import { ColorPasswordComponent } from "@bitwarden/components/src/color-password/color-password.component";
Expand Down

0 comments on commit 3db1bca

Please sign in to comment.