-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(NcAppNavigationItem): Ensure primary styling when the item is active
Signed-off-by: Ferdinand Thiessen <[email protected]>
- Loading branch information
Showing
9 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
Binary file added
BIN
+3.09 KB
...avigationItem.cy.ts/NcAppNavigationItem-primary-on-active-route-menu-active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.13 KB
...ts/base/AppNavigationItem.cy.ts/NcAppNavigationItem-primary-on-active-route.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+719 Bytes
.../base/AppNavigationItem.cy.ts/NcAppNavigationItem-tertiary-non-active-route.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { mount } from 'cypress/vue2' | ||
import Vue, { defineComponent } from 'vue' | ||
import VueRouter from 'vue-router' | ||
|
||
import NcAppNavigationItem from '../../src/components/NcAppNavigationItem/NcAppNavigationItem.vue' | ||
|
||
describe('NcAppNavigationItem', () => { | ||
describe('With router link', () => { | ||
before(() => { | ||
const RouterComponent = defineComponent({ | ||
template: '<div style="width: 300px; background: white;"><NcAppNavigationItem name="Home" to="/" :editable="true" /><NcAppNavigationItem name="Foo" to="/foo" :editable="true" /></div>', | ||
components: { NcAppNavigationItem }, | ||
}) | ||
|
||
const router = new VueRouter({ | ||
routes: [ | ||
{ path: '/' }, | ||
{ path: '/foo' }, | ||
], | ||
}) | ||
|
||
Vue.use(VueRouter) | ||
|
||
mount(RouterComponent as never, { | ||
extensions: { | ||
plugins: [router], | ||
}, | ||
router, | ||
}) | ||
}) | ||
|
||
it('has tertiary styling on non active route', () => { | ||
cy.contains('.app-navigation-entry', 'Foo').compareSnapshot('NcAppNavigationItem-tertiary-non-active-route') | ||
}) | ||
|
||
it('has primary styling on active route', () => { | ||
cy.contains('.app-navigation-entry', 'Home').compareSnapshot('NcAppNavigationItem-primary-on-active-route') | ||
}) | ||
|
||
it('has primary button styling on active route with editing=true', () => { | ||
cy.contains('.app-navigation-entry', 'Home').find('.app-navigation-entry__actions').click() | ||
cy.get('.app-navigation-entry--editing').compareSnapshot('NcAppNavigationItem-primary-on-active-route-menu-active') | ||
}) | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters