mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 21:13:07 +00:00
Add Item Status Edit Actions
Add the Item Withdraw and Reistate action Add the make Item Private and Public action Add the Permanently Delete action
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import {ItemOperation} from './itemOperation.model';
|
||||
import {async, TestBed} from '@angular/core/testing';
|
||||
import {ItemOperationComponent} from './item-operation.component';
|
||||
import {TranslateModule} from '@ngx-translate/core';
|
||||
import {By} from '@angular/platform-browser';
|
||||
|
||||
describe('ItemOperationComponent', () => {
|
||||
let itemOperation: ItemOperation;
|
||||
|
||||
let fixture;
|
||||
let comp;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot()],
|
||||
declarations: [ItemOperationComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
itemOperation = new ItemOperation('key1', 'url1');
|
||||
|
||||
fixture = TestBed.createComponent(ItemOperationComponent);
|
||||
comp = fixture.componentInstance;
|
||||
comp.operation = itemOperation;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should render operation row', () => {
|
||||
const span = fixture.debugElement.query(By.css('span')).nativeElement;
|
||||
expect(span.textContent).toContain('item.edit.tabs.status.buttons.key1.label');
|
||||
const link = fixture.debugElement.query(By.css('a')).nativeElement;
|
||||
expect(link.href).toContain('url1');
|
||||
expect(link.textContent).toContain('item.edit.tabs.status.buttons.key1.button');
|
||||
});
|
||||
it('should render disabled operation row', () => {
|
||||
itemOperation.setDisabled(true);
|
||||
fixture.detectChanges();
|
||||
|
||||
const span = fixture.debugElement.query(By.css('span')).nativeElement;
|
||||
expect(span.textContent).toContain('item.edit.tabs.status.buttons.key1.label');
|
||||
const span2 = fixture.debugElement.query(By.css('span.btn-danger')).nativeElement;
|
||||
expect(span2.textContent).toContain('item.edit.tabs.status.buttons.key1.button');
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user