fix: cleanup / unnecessary changes reverted

(cherry picked from commit 55d2f0ce38)
This commit is contained in:
Jukka Lipka
2025-05-26 12:51:24 +02:00
committed by github-actions[bot]
parent f506be3dea
commit d3b098b407

View File

@@ -180,14 +180,17 @@ describe('ComcolRoleComponent', () => {
name: 'custom group name',
};
statusCode = 200;
comp.comcolRole = {
name: 'test role name' + Math.random(),
href: 'test role link',
};
comp.roleName$ = of(comcolRole.name);
comp.comcolRole = comcolRole;
fixture.detectChanges();
});
afterEach(() => {
const modal = document.querySelector('ds-confirmation-modal');
if (modal) {
modal.remove();
}
});
it('should have a delete button but no create or restrict button', (done) => {
expect(de.query(By.css('.btn.create'))).toBeNull();
expect(de.query(By.css('.btn.restrict'))).toBeNull();
@@ -201,16 +204,8 @@ describe('ComcolRoleComponent', () => {
de.query(By.css('.btn.delete')).nativeElement.click();
});
afterEach(() => {
const modal = document.querySelector('ds-confirmation-modal');
if (modal) {
modal.remove();
}
});
it('should call the groupService delete method', (done) => {
(document as any).querySelector('.modal-footer .confirm').click();
fixture.detectChanges();
expect(groupService.deleteComcolGroup).toHaveBeenCalled();
done();
});
@@ -220,20 +215,10 @@ describe('ComcolRoleComponent', () => {
beforeEach(() => {
groupService.deleteComcolGroup.and.returnValue(createFailedRemoteDataObject$());
de.query(By.css('.btn.delete')).nativeElement.click();
fixture.detectChanges();
});
afterEach(() => {
const modal = document.querySelector('ds-confirmation-modal');
if (modal) {
modal.remove();
}
});
it('should show an error notification', (done) => {
(document as any).querySelector('.modal-footer .confirm').click();
fixture.detectChanges();
expect(notificationsService.error).toHaveBeenCalled();
done();
});