Skip to content

Commit

Permalink
Correctly apply server CSS styles
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 24, 2020
1 parent d4d6810 commit 249dac7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 21 additions & 3 deletions tests/visual/components/AppSidebar/AppSidebar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,29 @@ import { mount } from 'cypress-vue-unit-test'
import AppSidebar from '../../../../src/components/AppSidebar/AppSidebar.vue'
// import ActionButton from '../../../../src/components/ActionButton/ActionButton.vue'

// Server CSS styles
import server from '../../../../styleguide/assets/server.css'
import icons from '../../../../styleguide/assets/icons.css'
import variables from '../../../../styleguide/assets/variables.css'

describe('AppSidebar.vue', () => {
'use strict'

it('Renders.', () => {
/**
* We need this custom style because we run the AppSidebar component without a Content component,
* which applies this rule:
* https://github.com/nextcloud/nextcloud-vue/blob/master/src/components/Content/Content.vue#L73-L75
*/
const style = `
* {
box-sizing: border-box;
}
`
// Load the server CSS styles
const cssFiles = [server, icons, variables]

mount(AppSidebar, {
attachTo: document.body,
propsData: {
title: 'Sidebar title.',
subtitle: 'subtitle',
Expand All @@ -40,9 +57,10 @@ describe('AppSidebar.vue', () => {
slots: {
default: ['<div />'],
},
style,
cssFiles,
})
cy.contains('Sidebar title.')

cy.matchImageSnapshot()
cy.get('.app-sidebar').matchImageSnapshot()
})
})

0 comments on commit 249dac7

Please sign in to comment.