Skip to content

Commit

Permalink
Merge pull request #5286 from nextcloud-libraries/fix/app-nav-spacer
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Feb 22, 2024
2 parents ec3691b + bf8a2f1 commit c867476
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
26 changes: 26 additions & 0 deletions cypress/component/NcAppNavigationSpacer.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import NcAppNavigation from '../../src/components/NcAppNavigation/NcAppNavigation.vue'
import NcAppNavigationItem from '../../src/components/NcAppNavigationItem/NcAppNavigationItem.vue'
import NcAppNavigationSpacer from '../../src/components/NcAppNavigationSpacer/NcAppNavigationSpacer.vue'

describe('NcAppNavigationSpacer', () => {
it('works', () => {
cy.mount({
render: (h) => h(NcAppNavigation, {
scopedSlots: {
list: () => [
h(NcAppNavigationItem, { props: { name: 'First' } }),
h(NcAppNavigationSpacer),
h(NcAppNavigationItem, { props: { name: 'Second' } }),
],
},
}),
})

cy.contains('li', 'First').should('exist').then(($first) => {
cy.contains('li', 'Second').should('exist').then(($second) => {
// Check that the second element is at least 22px below the first one (thats our spacer)
expect($second.offset()!.top - 22).gte($first.offset()!.top + $first.height()!)
})
})
})
})
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"@vue/vue2-jest": "^29.0.0",
"babel-jest": "^29.0.1",
"babel-loader-exclude-node-modules-except": "^1.2.1",
"cypress": "^13.1.0",
"cypress": "^13.6.5",
"cypress-visual-regression": "^5.0.0",
"eslint-plugin-cypress": "^2.11.1",
"file-loader": "^6.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export default {
<style scoped>
.app-navigation-spacer {
flex-shrink: 0;
order: 1;
height: 22px;
}

Expand Down

0 comments on commit c867476

Please sign in to comment.