Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Jun 25, 2020
1 parent 65b9a07 commit af51dbf
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
@@ -1,7 +1,7 @@
const moment = require('moment')
const parser = require('cookie-parser')
const e2e = require('../support/helpers/e2e').default
const humanInterval = require('human-interval')
import moment from 'moment'
import parser from 'cookie-parser'
import e2e from '../support/helpers/e2e'
import humanInterval from 'human-interval'

const onServer = function (app) {
app.use(parser())
Expand Down
@@ -1,6 +1,6 @@
const bodyParser = require('body-parser')
const cookieParser = require('cookie-parser')
const e2e = require('../support/helpers/e2e').default
import bodyParser from 'body-parser'
import cookieParser from 'cookie-parser'
import e2e from '../support/helpers/e2e'

let counts = null

Expand Down
@@ -1,7 +1,7 @@
const cors = require('cors')
const parser = require('cookie-parser')
const session = require('express-session')
const e2e = require('../support/helpers/e2e').default
import cors from 'cors'
import parser from 'cookie-parser'
import session from 'express-session'
import e2e from '../support/helpers/e2e'

const onServer = function (app) {
app.use(parser())
Expand Down Expand Up @@ -48,7 +48,7 @@ const onServer = function (app) {
cookie: {
sameSite: true,
},
})
}) as Function

app.get('/htmlCookies', (req, res) => {
const {
Expand Down
Expand Up @@ -24,7 +24,7 @@ describe "cookies", ->
expect(c.expiry).to.be.a("number")

expect(c).to.have.keys(
"domain", "name", "value", "path", "secure", "httpOnly", "expiry"
"domain", "name", "value", "path", "sameSite", "secure", "httpOnly", "expiry"
)
.getCookies()
.should("have.length", 1)
Expand All @@ -40,7 +40,7 @@ describe "cookies", ->
expect(c.expiry).to.be.a("number")

expect(c).to.have.keys(
"domain", "name", "value", "path", "secure", "httpOnly", "expiry"
"domain", "name", "value", "path", "sameSite", "secure", "httpOnly", "expiry"
)
.clearCookies()
.should("be.null")
Expand All @@ -55,7 +55,7 @@ describe "cookies", ->
expect(c.expiry).to.be.a("number")

expect(c).to.have.keys(
"domain", "name", "value", "path", "secure", "httpOnly", "expiry"
"domain", "name", "value", "path", "sameSite", "secure", "httpOnly", "expiry"
)
.clearCookie("wtf")
.should("be.null")
Expand Down
Expand Up @@ -20,14 +20,14 @@ describe "redirects + requests", ->
expect(cookies[0].secure).to.eq(false)
expect(cookies[0].expiry).to.be.closeTo(oneMinuteFromNow, 5)

expect(cookies[1]).to.deep.eq({
expect(cookies[1]).to.deep.eq(Cypress._.merge({
domain: "localhost"
name: "2293-session"
value: "true"
httpOnly: false
path: "/"
secure: false
})
}, (if Cypress.isBrowser('firefox') then { sameSite: 'no_restriction' } else {})))

it "visits to a different superdomain will be resolved twice", ->
cy
Expand Down
Expand Up @@ -42,7 +42,7 @@ describe "subdomains", ->
cy
.visit("http://domain.foobar.com:2292")
.getCookies().should("have.length", 1)
.getCookie("nomnom").should("deep.eq", {
.getCookie("nomnom").should("include", {
domain: ".foobar.com"
name: "nomnom"
value: "good"
Expand Down

0 comments on commit af51dbf

Please sign in to comment.