-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtest.spec.js
More file actions
39 lines (36 loc) · 964 Bytes
/
test.spec.js
File metadata and controls
39 lines (36 loc) · 964 Bytes
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
/// <reference types="cypress" />
const { watchFile } = require("fs")
context('Page load', () => {
beforeEach(() => {
cy.visit('/')
cy.wait(1000)
})
describe('React integration', () => {
it('Should mount', () => {
cy.get('#app')
.should('exist', 'success')
})
it('Should have foo property on button', () => {
cy.get('.clicker')
// .its('foo')
// .should('eq', 3)
.then(($el) => {
const el = $el[0]
cy.wrap(el.foo).should('eq', 3)
})
})
it('Should allow toggling className items based on domClass prop', () => {
cy.get('.clicker')
.then(($el) => {
cy.wrap($el[0].className).should('eq', 'clicker hello')
})
})
it('Should return element when ref function is sent', () => {
cy.get('h1')
.then(($el) => {
const el = $el[0]
cy.wrap(el.foo).should('eq', 'bar')
})
})
})
})