mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-01 19:34:17 +01:00
chore: replacing percy with cypress-image-snapshots
This commit is contained in:
@@ -47,7 +47,11 @@ export const imgSnapshotTest = (graphStr, _options, api) => {
|
||||
|
||||
cy.visit(url);
|
||||
cy.get('svg');
|
||||
cy.percySnapshot();
|
||||
// cy.percySnapshot();
|
||||
// Default name to test title
|
||||
const name = (options.name || cy.state('runnable').fullTitle()).replace(/\s+/g, '-');
|
||||
|
||||
cy.matchImageSnapshot(name);
|
||||
};
|
||||
|
||||
export const renderGraph = (graphStr, options, api) => {
|
||||
|
||||
@@ -4,7 +4,7 @@ describe('Pie Chart', () => {
|
||||
it('should render a simple pie diagram', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
pie title Sports in Sweden
|
||||
pie title Sports in Sweden!
|
||||
"Bandy" : 40
|
||||
"Ice-Hockey" : 80
|
||||
"Football" : 90
|
||||
|
||||
@@ -158,7 +158,7 @@ describe('State diagram', () => {
|
||||
);
|
||||
cy.get('svg');
|
||||
});
|
||||
it('v2 should render a simple state diagrams', () => {
|
||||
it('v2 should render a simple state diagrams 2', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
stateDiagram-v2
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
// // `config` is the resolved Cypress config
|
||||
// }
|
||||
|
||||
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
|
||||
|
||||
module.exports = (on, config) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
addMatchImageSnapshotPlugin(on, config);
|
||||
};
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 166 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 162 KiB |
@@ -24,4 +24,8 @@
|
||||
// -- This is will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||
|
||||
import '@percy/cypress';
|
||||
// import '@percy/cypress';
|
||||
|
||||
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
|
||||
|
||||
addMatchImageSnapshotCommand();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands';
|
||||
import '@percy/cypress';
|
||||
// import '@percy/cypress';
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
|
||||
Reference in New Issue
Block a user