Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leftnav nav-sync issue #1271

Merged
merged 9 commits into from
Apr 21, 2020
1 change: 1 addition & 0 deletions core/src/App.html
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@
node.openNodeInModal === true ? {} : node.openNodeInModal
);
} else {
getComponentWrapper().set({ isNavigationSyncEnabled: true });
Routing.handleRouteClick(node, getComponentWrapper());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,64 @@ describe('Navigation', () => {

cy.get('[data-testid=modal-mf]').should('not.be.visible');
});

it('Nav sync - click sidenav', () => {
// projects page
cy.get('.fd-shellbar')
.contains('Projects')
.click();

//projects page
cy.get('.fd-app__sidebar')
.contains('Project Two')
.click();

cy.get('.fd-app__sidebar')
.contains('Nav Sync')
.click();

cy.expectPathToBe('/projects/pr2/nav-sync/one');

['four', 'three', 'two', 'three', 'two'].forEach(label => {
cy.get('.fd-app__sidebar')
.contains(label)
.click();

cy.expectPathToBe('/projects/pr2/nav-sync/' + label);

cy.getIframeBody().then($iframeBody => {
cy.wrap($iframeBody)
.find('.fd-list-group__item')
.contains('Current pathsegment: ' + label);
});
});
});
it('Nav sync - use synched nav', () => {
// projects page
cy.get('.fd-shellbar')
.contains('Projects')
.click();

//projects page
cy.get('.fd-app__sidebar')
.contains('Project Two')
.click();

cy.get('.fd-app__sidebar')
.contains('Nav Sync')
.click();

cy.expectPathToBe('/projects/pr2/nav-sync/one');

['two', 'three', 'four', 'one'].forEach((label, index) => {
cy.getIframeBody().then($iframeBody => {
cy.wrap($iframeBody)
.find('.fd-link')
.click();
});
cy.expectPathToBe('/projects/pr2/nav-sync/' + label);
});
});
});
describe('Horizontal Tab Navigation', () => {
context('Desktop', () => {
Expand Down