mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-03 15:46:43 +02:00
Updating cypress tests
This commit is contained in:
11
cypress/integration/other/webpackUsage.spec.js
Normal file
11
cypress/integration/other/webpackUsage.spec.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/* eslint-env jest */
|
||||
describe('Sequencediagram', () => {
|
||||
it('should render a simple sequence diagrams', () => {
|
||||
const url = 'http://localhost:9000/webpackUsage.html';
|
||||
|
||||
cy.visit(url);
|
||||
cy.get('body')
|
||||
.find('svg')
|
||||
.should('have.length', 2);
|
||||
});
|
||||
});
|
16
cypress/integration/other/xss.spec.js
Normal file
16
cypress/integration/other/xss.spec.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/* eslint-env jest */
|
||||
import { mermaidUrl } from '../../helpers/util.js';
|
||||
|
||||
/* eslint-disable */
|
||||
describe('XSS', () => {
|
||||
it('should handle xss in tags', () => {
|
||||
const str = 'eyJjb2RlIjoiXG5ncmFwaCBMUlxuICAgICAgQi0tPkQoPGltZyBvbmVycm9yPWxvY2F0aW9uPWBqYXZhc2NyaXB0XFx1MDAzYXhzc0F0dGFja1xcdTAwMjhkb2N1bWVudC5kb21haW5cXHUwMDI5YCBzcmM9eD4pOyIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0In19';
|
||||
|
||||
const url = mermaidUrl(str,{}, true);
|
||||
|
||||
cy.visit(url);
|
||||
cy.get('svg')
|
||||
cy.percySnapshot()
|
||||
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user