-
Notifications
You must be signed in to change notification settings - Fork 10.3k
/
js-frontmatter.js
29 lines (24 loc) · 1018 Bytes
/
js-frontmatter.js
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
describe(`webpack loader`, () => {
it(`---js frontmatter should not parse by default`, () => {
cy.visit(`/js-frontmatter`).waitForRouteChange()
// Check frontmatter not parsed in page context
cy.get(`[data-cy="js-frontmatter"]`).invoke(`text`).should(`eq`, `disabled`)
})
it(`---javascript frontmatter should not parse by default`, () => {
cy.visit(`/javascript-frontmatter`).waitForRouteChange()
// Check frontmatter not parsed in page context
cy.get(`[data-cy="js-frontmatter"]`).invoke(`text`).should(`eq`, `disabled`)
})
})
describe(`data layer`, () => {
it(`---js or ---javascript frontmatter should not parse by default`, () => {
cy.visit(`/mdx-query-js-frontmatter/`).waitForRouteChange()
cy.contains(`I should not be parsed`).should("not.exist")
})
})
it(`---js and ---javascript frontmatter should not allow remote code execution`, () => {
cy.readFile(`cypress/fixtures/file-to-attempt-rce-on.txt`).should(
`eq`,
`Nothing here, do not remove`
)
})