-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
InlineRunAllSpecs.cy.tsx
39 lines (34 loc) · 1.17 KB
/
InlineRunAllSpecs.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
31
32
33
34
35
36
37
38
39
import InlineRunAllSpecs from './InlineRunAllSpecs.vue'
describe('<InlineRunAllSpecs/>', () => {
context('Correctly rendered for Inline Specs list', () => {
beforeEach(() => {
cy.mount(() => {
return (
<div class="flex justify-center">
<InlineRunAllSpecs specNumber={40} directory='cypress/e2e' />
</div>
)
})
})
it('renders component correctly', () => {
cy.findByTestId('run-all-specs-for-cypress/e2e').children().should('have.length', 1)
cy.findByTestId('play-button').should('be.visible')
})
it('provides expected tooltip content', () => {
cy.findByTestId('tooltip-content').should('not.exist')
cy.findByTestId('run-all-specs-for-cypress/e2e').realHover().then(() => {
cy.findByTestId('tooltip-content').should('contain.text', 'Run 40 specs')
})
})
})
it('disables button when no specs are available', () => {
cy.mount(() => {
return (
<div class="flex justify-center">
<InlineRunAllSpecs specNumber={0} directory='cypress/e2e' />
</div>
)
})
cy.findByTestId('run-all-specs-button').should('be.disabled')
})
})