Skip to content

Commit

Permalink
refactor: remove control story
Browse files Browse the repository at this point in the history
  • Loading branch information
Cr0zy07 committed Nov 28, 2023
1 parent df6a0e4 commit 3290bcb
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 44 deletions.
15 changes: 0 additions & 15 deletions packages/components/label/src/stories/Label.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,3 @@ export const WithControl: Story = {
`,
}),
}

export const Control: Story = {
args: {
template: 'Control',
},
render: (args: any) => ({
components: { OkuLabel },
setup() {
return { args }
},
template: `
<OkuLabel v-bind="args" />
`,
}),
}
6 changes: 1 addition & 5 deletions packages/components/label/src/stories/LabelDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Control from './Control.vue'
withDefaults(defineProps<ILabelProps>(), {})
export interface ILabelProps {
template?: 'Styled' | 'WithControl' | 'Control'
template?: 'Styled' | 'WithControl'
allshow?: boolean
}
</script>
Expand All @@ -20,10 +20,6 @@ export interface ILabelProps {
<template v-if="template === 'WithControl' || allshow">
<WithControl />
</template>

<template v-if="template === 'Control' || allshow">
<Control />
</template>
</div>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`okuLabel Stories > control > should render correctly 1`] = `"<button class=\\"label-control\\"> Control </button>"`;
exports[`okuLabel Stories > styled > should render correctly 1`] = `"<oku-label-stub aschild=\\"false\\" class=\\"label\\"></oku-label-stub>"`;
exports[`okuLabel Stories > withControl > should render correctly 1`] = `
Expand Down
22 changes: 0 additions & 22 deletions packages/components/label/tests/label.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { OkuLabel } from '../src'

import Styled from '../src/stories/Styled.vue'
import WithControl from '../src/stories/WithControl.vue'
import Control from '../src/stories/Control.vue'

enableAutoUnmount(afterEach)

Expand Down Expand Up @@ -74,25 +73,4 @@ describe('okuLabel Stories', () => {
expect(wrapper.html()).toMatchSnapshot()
})
})

describe('control', () => {
let wrapper: VueWrapper<InstanceType<typeof Control>>

beforeEach(async () => {
wrapper = shallowMount(Control, {
attachTo: document.body,
})
})

/**
* @vitest-environment jsdom
*/
it('should have no accessibility violations', async () => {
expect(await axe(wrapper.element)).toHaveNoViolations()
})

it('should render correctly', () => {
expect(wrapper.html()).toMatchSnapshot()
})
})
})

0 comments on commit 3290bcb

Please sign in to comment.