Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit f120378

Browse files
committed
wip
1 parent 2708c27 commit f120378

File tree

20 files changed

+228
-11
lines changed

20 files changed

+228
-11
lines changed

packages/c-accordion/tests/c-accordion.test.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import CAccordion from '../src'
2+
import { h } from 'vue'
3+
4+
it('should render properly', () => {
5+
cy.mount(<CAccordion></CAccordion>)
6+
})

packages/c-alert/examples/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export * as BaseAlert from './base-alert.vue'
2+
export * as WithAccent from './with-accent.vue'
3+
export * as WithIcon from './with-icon.vue'
4+
export * as WithStatus from './with-status.vue'
5+
export * as WithTitle from './with-title.vue'
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import * as Examples from '../examples'
2+
import { h } from 'vue'
3+
import { CAlert, CAlertDescription, CAlertIcon, CAlertTitle } from '../src'
4+
5+
describe('Alert Examples', () => {
6+
Object.entries(Examples).map(([name, example]) => {
7+
it(`renders ${name} successfully`, () => {
8+
cy.mount(example.default).checkA11y()
9+
})
10+
})
11+
})
12+
13+
it('contains the correct role', () => {
14+
cy.mount(Examples.BaseAlert.default)
15+
.get('[role=alert]')
16+
.should('exist')
17+
})
18+
19+
it('renders its children', () => {
20+
cy.mount(
21+
<CAlert data-testid="alert" variant="left-accent" status="info" mb="3">
22+
<CAlertIcon mr="2" />
23+
<CAlertTitle> Info alert </CAlertTitle>
24+
<CAlertDescription> Something just happened </CAlertDescription>
25+
</CAlert>
26+
).get('[data-testid=alert]')
27+
.should('contain', 'Info alert')
28+
.and('contain', 'Something just happened')
29+
.and('descendants', 'svg')
30+
})

packages/c-badge/examples/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * as BaseBadge from './base-badge.vue'
2+
export * as OutlineBadges from './outline-badges.vue'
3+
export * as SolidBadge from './solid-badge.vue'
4+
export * as SubtleBadges from './subtle-badges.vue'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as Examples from '../examples'
2+
import { h } from 'vue'
3+
4+
describe('Badge Examples', () => {
5+
Object.entries(Examples).map(([name, example]) => {
6+
it(`renders ${name} successfully`, () => {
7+
cy.mount(example.default).checkA11y()
8+
})
9+
})
10+
})

packages/c-flex/examples/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * as BaseFlex from './base-flex.vue'
2+
export * as DirectionFlex from './direction-flex.vue'

packages/c-flex/tests/c-flex.test.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as Examples from '../examples'
2+
import { h } from 'vue'
3+
4+
describe('Flex Examples', () => {
5+
it('works', () => {
6+
expect(true).to.be.true
7+
})
8+
9+
Object.entries(Examples).map(([name, example]) => {
10+
it(`renders ${name} successfully`, () => {
11+
cy.mount(example.default).checkA11y()
12+
})
13+
})
14+
})

packages/c-icon/examples/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * as BaseIcon from './base-icon.vue'
2+
export * as WithColor from './with-color.vue'
3+
export * as WithIconLibrary from './with-icon-library.vue'
4+
export * as WithSize from './with-size.vue'

packages/c-icon/tests/c-icon.test.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as Examples from '../examples'
2+
import { h } from 'vue'
3+
4+
describe('Icon Examples', () => {
5+
it('works', () => {
6+
expect(true).to.be.true
7+
})
8+
9+
Object.entries(Examples).map(([name, example]) => {
10+
it(`renders ${name} successfully`, () => {
11+
cy.mount(example.default).checkA11y()
12+
})
13+
})
14+
})

0 commit comments

Comments
 (0)