-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
DashboardEntry.cy.tsx
30 lines (26 loc) · 994 Bytes
/
DashboardEntry.cy.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { faker } from '@faker-js/faker'
import DashboardEntry from './DashboardEntry.vue'
const body = () => (<div data-testid="body-content">{ faker.lorem.words(2) }</div>)
const header = () => (<div data-testid="header-content">{ faker.hacker.phrase() }</div>)
const bodySelector = '[data-testid=body-content]'
const headerSelector = '[data-testid=header-content]'
const tailSelector = '[data-testid=tail]'
describe('DashboardEntry', () => {
it('tail is rendered by default', () => {
cy.mount(<DashboardEntry v-slots={{ body, header }}/>)
.get(tailSelector)
.should('exist')
})
it('tail is not shown when true', () => {
cy.mount(<DashboardEntry tail v-slots={{ body, header }}/>)
.get(tailSelector)
.should('not.exist')
})
it('renders the body and header slots', () => {
cy.mount(<DashboardEntry v-slots={{ body, header }}/>)
.get(bodySelector)
.should('be.visible')
.get(headerSelector)
.should('be.visible')
})
})