mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 21:13:07 +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',
|
||||
};
|
||||
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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user