[web] convert final acceptance tests to es modules GitOrigin-RevId: d0d0cd3dfedbe494ce51dd6f8c180dff02429ad8
23 lines
577 B
JavaScript
23 lines
577 B
JavaScript
import { expect } from 'chai'
|
|
|
|
export default {
|
|
requireLogin: {
|
|
json(response, body) {
|
|
expect(response.statusCode).to.equal(401)
|
|
expect(body).to.equal('Unauthorized')
|
|
expect(response.headers['www-authenticate']).to.equal('OverleafLogin')
|
|
},
|
|
},
|
|
|
|
restricted: {
|
|
html(response, body) {
|
|
expect(response.statusCode).to.equal(403)
|
|
expect(body).to.match(/<head><title>Restricted/)
|
|
},
|
|
json(response, body) {
|
|
expect(response.statusCode).to.equal(403)
|
|
expect(body).to.deep.equal({ message: 'restricted' })
|
|
},
|
|
},
|
|
}
|