Skip to content

Commit

Permalink
Cover more cases in AppSidebare visual test
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <[email protected]>
  • Loading branch information
raimund-schluessler committed Aug 27, 2020
1 parent c845012 commit c4ccd75
Show file tree
Hide file tree
Showing 121 changed files with 39 additions and 29 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 39 additions & 29 deletions tests/visual/components/AppSidebar/AppSidebar.visual.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ describe('AppSidebar.vue', () => {
const cssFiles = [server, icons, variables]

// Possible props and actions
const title = 'Very long title that will certainly overflow the sidebar width'
const subtitles = ['', 'Very long subtitle what will certainly overflow the sidebar width']
const titleEditable = [false, true]
const starred = [null, false, true]
const compact = [false, true]
const header = ['', '<div style="background: no-repeat center/contain var(--icon-folder-000); height: 100%;" />']
Expand All @@ -64,37 +67,44 @@ describe('AppSidebar.vue', () => {
components,
}

starred.forEach(star => {
compact.forEach(comp => {
header.forEach(head => {
secondary.forEach(second => {
const fileName = `AppSidebar.vue
- starred_${star === null ? 'null' : star ? 'true' : 'false'}
- compact_${comp ? 'true' : 'false'}
- header_${head ? 'image' : 'none'}
- secondary_${second ? 'button' : 'none'}
`.replace(/(\n|\t)/gi, '')
subtitles.forEach(subtitle => {
titleEditable.forEach(editable => {
starred.forEach(star => {
compact.forEach(comp => {
header.forEach(head => {
secondary.forEach(second => {
const fileName = `AppSidebar.vue
- subtitle_${subtitle ? 'true' : 'null'}
- editable_${editable ? 'true' : 'false'}
- starred_${star === null ? 'null' : star ? 'true' : 'false'}
- compact_${comp ? 'true' : 'false'}
- header_${head ? 'image' : 'none'}
- secondary_${second ? 'button' : 'none'}
`.replace(/(\n|\t)/gi, '')

const defaultOptions = {
propsData: {
title: 'Sidebar title.',
subtitle: 'subtitle',
starred: star,
compact: comp,
},
slots: {
default: ['<div />'],
header: head,
'secondary-actions': second,
},
style,
cssFiles,
extensions,
}
const defaultOptions = {
propsData: {
title,
subtitle,
starred: star,
compact: comp,
titleEditable: editable,
},
slots: {
default: ['<div />'],
header: head,
'secondary-actions': second,
},
style,
cssFiles,
extensions,
}

it('Renders ' + fileName, () => {
mount(AppSidebar, defaultOptions)
cy.get('.app-sidebar-header').compareSnapshot(fileName)
it('Renders ' + fileName, () => {
mount(AppSidebar, defaultOptions)
cy.get('.app-sidebar-header').compareSnapshot(fileName)
})
})
})
})
})
Expand Down

0 comments on commit c4ccd75

Please sign in to comment.