-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy pathiframes_spec.js
More file actions
32 lines (26 loc) · 950 Bytes
/
iframes_spec.js
File metadata and controls
32 lines (26 loc) · 950 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
require('../spec_helper')
const { iframesController } = require('../../lib/controllers/iframes')
const files = require('../../lib/controllers/files')
describe('controllers/iframes', () => {
describe('e2e', () => {
it('sets Origin-Agent-Cluster response header to false', () => {
sinon.stub(files, 'handleIframe')
const mockReq = {}
const mockRes = {
setHeader: sinon.stub(),
}
const controllerOptions = {
getSpec: sinon.stub(),
remoteStates: sinon.stub(),
config: {},
}
iframesController.e2e(controllerOptions, mockReq, mockRes)
expect(mockRes.setHeader).to.have.been.calledWith('Origin-Agent-Cluster', '?0')
expect(files.handleIframe).to.have.been.calledWith(
mockReq, mockRes, controllerOptions.config, controllerOptions.remoteStates, sinon.match({
specFilter: undefined, specType: 'integration',
}),
)
})
})
})