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>
|
||||
|
||||
<div *ngIf="!hasNoData()" class="d-flex justify-content-end mt-2 mb-2 refresh-container">
|
||||
<button type="button" class="btn btn-secondary pull-right" (click)="refresh()">
|
||||
<div *ngIf="!hasNoData()" class="d-flex justify-content-end mt-2 mb-2">
|
||||
<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>
|
||||
</button>
|
||||
</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 { SubmissionServiceStub } from '../../../shared/testing/submission-service.stub';
|
||||
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 { SectionsServiceStub } from '../../../shared/testing/sections-service.stub';
|
||||
@@ -89,7 +89,7 @@ describe('SubmissionSectionSherpaPoliciesComponent', () => {
|
||||
});
|
||||
|
||||
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', () => {
|
||||
@@ -105,7 +105,7 @@ describe('SubmissionSectionSherpaPoliciesComponent', () => {
|
||||
});
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user