Merge branch 'develop' into 1252_gitgraph_reinvented

This commit is contained in:
Knut Sveidqvist
2022-03-31 19:16:31 +02:00
18 changed files with 332 additions and 608 deletions

View File

@@ -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) => {

View File

@@ -111,7 +111,9 @@ describe('Configuration', () => {
cy.visit(url);
cy.get('svg');
cy.percySnapshot();
cy.matchImageSnapshot(
'configuration.spec-should-not-taint-initial-configuration-when-using-multiple-directives'
);
});
});
});

View File

@@ -134,7 +134,7 @@ graph TD
const url = 'http://localhost:9000/theme-directives.html';
cy.visit(url);
cy.get('svg');
cy.percySnapshot();
cy.matchImageSnapshot('conf-and-directives.spec-when-rendering-several-diagrams-diagram-1');
});
});
});

View File

@@ -552,7 +552,7 @@ context('Sequence diagram', () => {
}
);
});
it('should override config with directive settings', () => {
it('should override config with directive settings 2', () => {
imgSnapshotTest(
`
%%{init: { "config": { "mirrorActors": false, "wrap": true }}}%%

View File

@@ -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

View File

@@ -148,7 +148,7 @@ describe('State diagram', () => {
);
cy.get('svg');
});
it('should render a simple state diagrams', () => {
it('should render a simple state diagrams 2', () => {
imgSnapshotTest(
`
stateDiagram

View File

@@ -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);
};

View File

@@ -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();

View File

@@ -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')