Skip to content
Snippets Groups Projects
Commit a554394e authored by Alexander Reifschneider's avatar Alexander Reifschneider
Browse files

Revert "Fix unit-tests "init users""

This reverts commit 116a73db.
parent fc13f5da
Branches
Tags
1 merge request!26Fix e2e tests
...@@ -32,7 +32,6 @@ import { ...@@ -32,7 +32,6 @@ import {
import { getElementFromFixture } from '@alfa-client/test-utils'; import { getElementFromFixture } from '@alfa-client/test-utils';
import { SpinnerComponent } from '@alfa-client/ui'; import { SpinnerComponent } from '@alfa-client/ui';
import { NO_NAME_MESSAGE, UserProfileResource, userProfileMessage } from '@alfa-client/user-profile-shared'; import { NO_NAME_MESSAGE, UserProfileResource, userProfileMessage } from '@alfa-client/user-profile-shared';
import { SimpleChange } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatIcon } from '@angular/material/icon'; import { MatIcon } from '@angular/material/icon';
import { faker } from '@faker-js/faker'; import { faker } from '@faker-js/faker';
...@@ -120,27 +119,6 @@ describe('UserIconComponent', () => { ...@@ -120,27 +119,6 @@ describe('UserIconComponent', () => {
}); });
}); });
describe('ngOnChanges', () => {
const userProfileChange: SimpleChange = new SimpleChange(1, 2, true);
it('should get tooltip', () => {
component.getTooltip = jest.fn();
component.ngOnChanges({ userProfileStateResource: userProfileChange });
expect(component.getTooltip).toHaveBeenCalled();
});
it('should not get tooltip', () => {
component.getTooltip = jest.fn();
component.withTooltip = false;
component.ngOnChanges({ userProfileStateResource: userProfileChange });
expect(component.getTooltip).not.toHaveBeenCalled();
});
});
describe('tooltip', () => { describe('tooltip', () => {
it('should return user name', () => { it('should return user name', () => {
component.userProfileStateResource = createStateResource(userProfile); component.userProfileStateResource = createStateResource(userProfile);
......
...@@ -32,14 +32,13 @@ import { isUndefined } from 'lodash-es'; ...@@ -32,14 +32,13 @@ import { isUndefined } from 'lodash-es';
}) })
export class UserIconComponent { export class UserIconComponent {
@Input() userProfileStateResource: StateResource<UserProfileResource> = createEmptyStateResource<UserProfileResource>(); @Input() userProfileStateResource: StateResource<UserProfileResource> = createEmptyStateResource<UserProfileResource>();
@Input() withTooltip: boolean = true;
readonly messageCode = MessageCode; readonly messageCode = MessageCode;
tooltip: string; tooltip: string;
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
if (changes.userProfileStateResource && this.withTooltip) { if (changes.userProfileStateResource) {
this.tooltip = this.getTooltip(); this.tooltip = this.getTooltip();
} }
} }
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
button-content button-content
data-test-id="user-icon" data-test-id="user-icon"
[userProfileStateResource]="currentUserResource" [userProfileStateResource]="currentUserResource"
[withTooltip]="false"
class="user-profile-icon" class="user-profile-icon"
> >
</alfa-user-icon> </alfa-user-icon>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment