Skip to content
Snippets Groups Projects
Commit 28164b7a authored by OZGCloud's avatar OZGCloud
Browse files

OZG-1389 add test

parent d8b1ad60
No related branches found
No related tags found
No related merge requests found
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatIcon } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';
import { createStateResource } from '@goofy-client/tech-shared';
import { createEmptyStateResource, createStateResource } from '@goofy-client/tech-shared';
import { getElementFromFixture } from '@goofy-client/test-utils';
import { createUserProfileResource } from 'libs/user-profile-shared/test/user-profile';
import { UserIconComponent } from './user-icon.component';
......@@ -9,6 +10,9 @@ describe('UserIconComponent', () => {
let component: UserIconComponent;
let fixture: ComponentFixture<UserIconComponent>;
const profileAssignedIcon: string = '[data-test-id="user-profile-assigned"]';
const profileUnassigned: string = '[data-test-id="user-profile-unassigned"]';
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [MatTooltipModule],
......@@ -29,4 +33,25 @@ describe('UserIconComponent', () => {
it('should create', () => {
expect(component).toBeTruthy();
});
describe('on icon place', () => {
it('should show icon unassigned', () => {
component.userProfileStateResource = createEmptyStateResource();
fixture.detectChanges();
const element = getElementFromFixture(fixture, profileUnassigned);
expect(element).toBeInstanceOf(HTMLElement);
})
it('should show icon assigned', () => {
component.userProfileStateResource = createStateResource(createUserProfileResource());
fixture.detectChanges();
const element = getElementFromFixture(fixture, profileAssignedIcon);
expect(element).toBeInstanceOf(HTMLElement);
})
})
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment