Files
dspace-angular/src/app/shared/testing/browser-only-mock.pipe.ts
Yura Bondarenko d69a02e6cc 90978: Fix e2e tests failing due to interactions before page fully loaded
Now that we use initialNavigation: 'enabledBlocking', pages can appear to be loaded before some functionality is fully active.
In some cases this trips up Cypress, and it tries to interact with the app too soon.

We address this by introducing a new dsBrowserOnly pipe in order to defer the data-test attributes Cypress relies on to CSR.
2022-05-04 15:25:46 +02:00

14 lines
270 B
TypeScript

import { Pipe, PipeTransform } from '@angular/core';
/**
* Support dsBrowserOnly in unit tests.
*/
@Pipe({
name: 'dsBrowserOnly'
})
export class BrowserOnlyMockPipe implements PipeTransform {
transform(value: string): string | undefined {
return value;
}
}