mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 05:23:06 +00:00
fix: cleanup / unnecessary changes reverted
(cherry picked from commit 55d2f0ce38
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
f506be3dea
commit
d3b098b407
@@ -180,14 +180,17 @@ describe('ComcolRoleComponent', () => {
|
|||||||
name: 'custom group name',
|
name: 'custom group name',
|
||||||
};
|
};
|
||||||
statusCode = 200;
|
statusCode = 200;
|
||||||
comp.comcolRole = {
|
comp.comcolRole = comcolRole;
|
||||||
name: 'test role name' + Math.random(),
|
|
||||||
href: 'test role link',
|
|
||||||
};
|
|
||||||
comp.roleName$ = of(comcolRole.name);
|
|
||||||
fixture.detectChanges();
|
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) => {
|
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.create'))).toBeNull();
|
||||||
expect(de.query(By.css('.btn.restrict'))).toBeNull();
|
expect(de.query(By.css('.btn.restrict'))).toBeNull();
|
||||||
@@ -201,16 +204,8 @@ describe('ComcolRoleComponent', () => {
|
|||||||
de.query(By.css('.btn.delete')).nativeElement.click();
|
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) => {
|
it('should call the groupService delete method', (done) => {
|
||||||
(document as any).querySelector('.modal-footer .confirm').click();
|
(document as any).querySelector('.modal-footer .confirm').click();
|
||||||
fixture.detectChanges();
|
|
||||||
expect(groupService.deleteComcolGroup).toHaveBeenCalled();
|
expect(groupService.deleteComcolGroup).toHaveBeenCalled();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@@ -220,20 +215,10 @@ describe('ComcolRoleComponent', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
groupService.deleteComcolGroup.and.returnValue(createFailedRemoteDataObject$());
|
groupService.deleteComcolGroup.and.returnValue(createFailedRemoteDataObject$());
|
||||||
de.query(By.css('.btn.delete')).nativeElement.click();
|
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) => {
|
it('should show an error notification', (done) => {
|
||||||
(document as any).querySelector('.modal-footer .confirm').click();
|
(document as any).querySelector('.modal-footer .confirm').click();
|
||||||
fixture.detectChanges();
|
|
||||||
|
|
||||||
expect(notificationsService.error).toHaveBeenCalled();
|
expect(notificationsService.error).toHaveBeenCalled();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user