Skip to content
Snippets Groups Projects
Commit 18b4b70e authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3074 OZG-3415 Refactoring after PR (2)

parent 3e6a5e0e
Branches
Tags
No related merge requests found
...@@ -28,6 +28,7 @@ import { createStateResource, EMPTY_STRING, HasLinkPipe } from '@goofy-client/te ...@@ -28,6 +28,7 @@ import { createStateResource, EMPTY_STRING, HasLinkPipe } from '@goofy-client/te
import { ButtonWithSpinnerComponent, IconButtonWithSpinnerComponent } from '@goofy-client/ui'; import { ButtonWithSpinnerComponent, IconButtonWithSpinnerComponent } from '@goofy-client/ui';
import { createCommandResource } from 'libs/command-shared/test/command'; import { createCommandResource } from 'libs/command-shared/test/command';
import { createPostfachMailListResource } from 'libs/postfach-shared/test/postfach'; import { createPostfachMailListResource } from 'libs/postfach-shared/test/postfach';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { PostfachMailButtonComponent } from './postfach-mail-button.component'; import { PostfachMailButtonComponent } from './postfach-mail-button.component';
...@@ -35,9 +36,9 @@ describe('PostfachMailButtonComponent', () => { ...@@ -35,9 +36,9 @@ describe('PostfachMailButtonComponent', () => {
let component: PostfachMailButtonComponent; let component: PostfachMailButtonComponent;
let fixture: ComponentFixture<PostfachMailButtonComponent>; let fixture: ComponentFixture<PostfachMailButtonComponent>;
const sendMailButtonWithText: string = '[data-test-id="create-mail-button-with-text"]'; const sendMailButtonWithText: string = getDataTestIdOf('create-mail-button-with-text');
const sendMailButtonWithoutText: string = '[data-test-id="create-mail-button-without-text"]'; const sendMailButtonWithoutText: string = getDataTestIdOf('create-mail-button-without-text');
const sendMailIconButton: string = '[data-test-id="send-mail-icon-button"]'; const sendMailIconButton: string = getDataTestIdOf('send-mail-icon-button');
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
...@@ -61,10 +62,14 @@ describe('PostfachMailButtonComponent', () => { ...@@ -61,10 +62,14 @@ describe('PostfachMailButtonComponent', () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
describe('send mail button with text', () => { describe('send mail button', () => {
beforeEach(() => { beforeEach(() => {
component.showAsIconButton = false; component.showAsIconButton = false;
})
describe('with text', () => {
beforeEach(() => {
component.text = faker.word.noun(); component.text = faker.word.noun();
component.toolTip = EMPTY_STRING; component.toolTip = EMPTY_STRING;
fixture.detectChanges(); fixture.detectChanges();
...@@ -90,10 +95,9 @@ describe('PostfachMailButtonComponent', () => { ...@@ -90,10 +95,9 @@ describe('PostfachMailButtonComponent', () => {
}); });
}) })
describe('send mail button without text', () => { describe('without text', () => {
beforeEach(() => { beforeEach(() => {
component.showAsIconButton = false;
component.text = EMPTY_STRING; component.text = EMPTY_STRING;
component.toolTip = faker.word.noun(); component.toolTip = faker.word.noun();
fixture.detectChanges(); fixture.detectChanges();
...@@ -119,6 +123,8 @@ describe('PostfachMailButtonComponent', () => { ...@@ -119,6 +123,8 @@ describe('PostfachMailButtonComponent', () => {
}); });
}) })
})
describe('send mail icon button', () => { describe('send mail icon button', () => {
beforeEach(() => { beforeEach(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment