mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[CST-5270] use data-test as css selector for unit test
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
<ds-alert [type]="'alert-info'" *ngIf="hasNoData()" [content]="'submission.sections.sherpa-policy.title-empty'">
|
<ds-alert [type]="'alert-info'" *ngIf="hasNoData()" [content]="'submission.sections.sherpa-policy.title-empty'">
|
||||||
</ds-alert>
|
</ds-alert>
|
||||||
|
|
||||||
<div *ngIf="!hasNoData()" class="d-flex justify-content-end mt-2 mb-2 refresh-container">
|
<div *ngIf="!hasNoData()" class="d-flex justify-content-end mt-2 mb-2">
|
||||||
<button type="button" class="btn btn-secondary pull-right" (click)="refresh()">
|
<button type="button" class="btn btn-secondary pull-right" (click)="refresh()" data-test="refresh-btn">
|
||||||
<span><i class="fas fa-sync"></i> {{'submission.sections.sherpa.publisher.policy.refresh' | translate}} </span>
|
<span><i class="fas fa-sync"></i> {{'submission.sections.sherpa.publisher.policy.refresh' | translate}} </span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
import { SharedModule } from './../../../shared/shared.module';
|
import { SharedModule } from '../../../shared/shared.module';
|
||||||
import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { SubmissionServiceStub } from '../../../shared/testing/submission-service.stub';
|
import { SubmissionServiceStub } from '../../../shared/testing/submission-service.stub';
|
||||||
import { SherpaDataResponse } from '../../../shared/mocks/section-sherpa-policies.service.mock';
|
import { SherpaDataResponse } from '../../../shared/mocks/section-sherpa-policies.service.mock';
|
||||||
import { ComponentFixture, inject, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
import { ComponentFixture, inject, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { SectionsService } from '../sections.service';
|
import { SectionsService } from '../sections.service';
|
||||||
import { SectionsServiceStub } from '../../../shared/testing/sections-service.stub';
|
import { SectionsServiceStub } from '../../../shared/testing/sections-service.stub';
|
||||||
@@ -89,7 +89,7 @@ describe('SubmissionSectionSherpaPoliciesComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should show refresh button', () => {
|
it('should show refresh button', () => {
|
||||||
expect(de.query(By.css('.refresh-container > button'))).toBeTruthy();
|
expect(de.query(By.css('[data-test="refresh-btn"]'))).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show publisher information', () => {
|
it('should show publisher information', () => {
|
||||||
@@ -105,7 +105,7 @@ describe('SubmissionSectionSherpaPoliciesComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('when refresh button click operationsBuilder.remove should have been called', () => {
|
it('when refresh button click operationsBuilder.remove should have been called', () => {
|
||||||
de.query(By.css('.refresh-container > button')).nativeElement.click();
|
de.query(By.css('[data-test="refresh-btn"]')).nativeElement.click();
|
||||||
expect(operationsBuilder.remove).toHaveBeenCalled();
|
expect(operationsBuilder.remove).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user