Skip to content

Commit 3c387f3

Browse files
Merge remote-tracking branch 'github/task/dspace-cris-2025_02_x/DSC-2748' into task/dspace-cris-2025_02_x/DSC-2748
2 parents 2f0463f + b0673d0 commit 3c387f3

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

cypress/support/e2e.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ import 'cypress-axe';
2121

2222
import { DSPACE_XSRF_COOKIE } from 'src/app/core/xsrf/xsrf.constants';
2323

24+
Cypress.Commands.overwrite('visit', (originalFn, url, options) => {
25+
return originalFn(url, options).then(() => {
26+
cy.get('[data-test="ds-hydrated"]');
27+
});
28+
});
29+
2430
// We might receive uncaught exceptions from external libraries (e.g. it happened before with a broken
2531
// version of the addToAny plugin). These should not cause our tests to fail, so we catch them here.
2632
Cypress.on('uncaught:exception', (err, runnable) => {

src/app/root/root.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import {
22
AsyncPipe,
3+
isPlatformBrowser,
34
NgClass,
45
} from '@angular/common';
56
import {
67
Component,
8+
HostBinding,
79
Inject,
810
Input,
911
OnInit,
@@ -70,6 +72,8 @@ import { SystemWideAlertBannerComponent } from '../system-wide-alert/alert-banne
7072
],
7173
})
7274
export class RootComponent implements OnInit {
75+
@HostBinding('attr.data-test') dataTestAttribute: string | null = null;
76+
7377
theme: Observable<ThemeConfig> = of({} as any);
7478
isSidebarVisible$: Observable<boolean>;
7579
slideSidebarOver$: Observable<boolean>;
@@ -99,6 +103,7 @@ export class RootComponent implements OnInit {
99103
@Inject(NativeWindowService) private _window: NativeWindowRef,
100104
) {
101105
this.notificationOptions = environment.notifications;
106+
this.dataTestAttribute = isPlatformBrowser(platformId) ? 'ds-hydrated' : null;
102107
}
103108

104109
ngOnInit() {

0 commit comments

Comments
 (0)