Skip to content

Commit

Permalink
Add e2e test for goBack dynamic node (SAP#2699)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndricimrr authored May 9, 2022
1 parent 0bf4f53 commit 01ef222
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,28 @@ describe('Luigi client linkManager', () => {
});
});

it('navigate with preserve view and goBack dynamic context', localRetries, () => {
//navigate with preserve view functionality
cy.wrap($iframeBody)
.contains('with preserved view: to dynamic node and go back')
.click();
cy.expectPathToBe('/projects/pr1/users/groups/test1/settings');

cy.getIframeBody().then($iframeBody => {
cy.wrap($iframeBody)
.contains('projects/pr1/users/groups/test2/settings')
.click();
cy.expectPathToBe('/projects/pr1/users/groups/test2/settings');

cy.getIframeBody().then($iframeBody => {
cy.wrap($iframeBody)
.contains('Go Back')
.click();
cy.expectPathToBe('/projects/pr1/users/groups/test1/settings');
});
});
});

it('path exists check', localRetries, () => {
[
// non-existent relative path
Expand Down
12 changes: 12 additions & 0 deletions test/e2e-test-application/src/app/project/project.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,18 @@ <h3 class="fd-layout-panel__title">Navigate</h3>
data="linkManager().navigate('/settings', null, true)"
></app-code-snippet>
</li>
<li class="fd-list__item">
<a
href="javascript:void(0)"
class="fd-link"
(click)="navigatePreservedViewGoBack()"
>
with preserved view: to dynamic node and go back
</a>
<app-code-snippet
data="linkManager().navigate('/projects/pr1/users/groups/test1/settings', null, true);"
></app-code-snippet>
</li>
<li class="fd-list__item">
<a
href="javascript:void(0)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ export class ProjectComponent implements OnInit, OnDestroy {
}, 2000);
}

navigatePreservedViewGoBack() {
linkManager().navigate('/projects/pr1/users/groups/test1/settings', null, true);
}

navigateWithSync(path) {
linkManager()['options'].withoutSync = false;
linkManager().navigate(path);
Expand Down Expand Up @@ -206,7 +210,7 @@ export class ProjectComponent implements OnInit, OnDestroy {

uxManager()
.showAlert(settings)
.then((data) => {
.then(data => {
if (typeof data === 'string' && data.includes('neverShowItAgain')) {
this.alertDismissKey = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,26 @@ <h3 class="fd-section__title">Group Settings</h3>
projects/pr2/users/groups/others/settings/dyn1
</div>
<br />

<div
class="clickable"
(click)="
linkManager().navigate(
'/projects/pr1/users/groups/test2/settings', null, true
)
"
>
projects/pr1/users/groups/test2/settings
</div>
<br />
<div
class="clickable"
(click)="
linkManager().goBack()
"
>
<b>Go Back</b>
</div>
<br />
<a
class="fd-link clickable"
(click)="
Expand Down

0 comments on commit 01ef222

Please sign in to comment.