Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added unit test to account-dialog.component #2254

Merged
merged 5 commits into from
Sep 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { describe, expect, it } from '@jest/globals';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { mount, NgxTestWrapper } from '../../../../../testing';
import { SharedModule } from '../../modules/shared/shared.module';

import { AccountDialogComponent } from './account-dialog.component';

describe('AccountDialogComponent', () => {
let wrapper: NgxTestWrapper<AccountDialogComponent>;
let component: AccountDialogComponent;
let fixture: ComponentFixture<AccountDialogComponent>;

beforeEach(async () => {
wrapper = await mount({
component: AccountDialogComponent,
declarations: [AccountDialogComponent],
providers: [],
imports: [SharedModule],
imports: [SharedModule, TranslateModule.forRoot(),],
schemas: [NO_ERRORS_SCHEMA],
});
fixture = TestBed.createComponent(AccountDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(wrapper.component.nativeElement).toMatchSnapshot();
});
});

it('should emit "handleLoginChange" when login is clicked', () => {
const login = wrapper.find(".active-primary");

login.emit('click');

expect(wrapper.emitted('handleLoginChange')).toBeTruthy();
});
});
Loading