merge branch feature/map-actions
@ -3,7 +3,7 @@ services:
|
|||||||
e2e:
|
e2e:
|
||||||
image: cypress/included:8.4.1
|
image: cypress/included:8.4.1
|
||||||
container_name: wisemapping-integration-tests
|
container_name: wisemapping-integration-tests
|
||||||
entrypoint: '/bin/sh -c "yarn install && yarn bootstrap && yarn test:integration"'
|
entrypoint: '/bin/sh -c "yarn bootstrap && yarn test:integration"'
|
||||||
working_dir: /e2e
|
working_dir: /e2e
|
||||||
environment:
|
environment:
|
||||||
- CYPRESS_imageSnaphots=true
|
- CYPRESS_imageSnaphots=true
|
||||||
|
@ -3,7 +3,7 @@ services:
|
|||||||
e2e:
|
e2e:
|
||||||
image: cypress/included:8.4.1
|
image: cypress/included:8.4.1
|
||||||
container_name: wisemapping-integration-tests
|
container_name: wisemapping-integration-tests
|
||||||
entrypoint: '/bin/sh -c "yarn install && yarn bootstrap && yarn test:integration"'
|
entrypoint: '/bin/sh -c "yarn bootstrap && yarn test:integration"'
|
||||||
working_dir: /e2e
|
working_dir: /e2e
|
||||||
environment:
|
environment:
|
||||||
- CYPRESS_imageSnaphots=true
|
- CYPRESS_imageSnaphots=true
|
||||||
|
6
packages/editor/.babelrc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
"@babel/preset-env",
|
||||||
|
"@babel/preset-react"
|
||||||
|
]
|
||||||
|
}
|
4
packages/editor/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
cypress/screenshots
|
||||||
|
cypress/videos
|
||||||
|
cypress/downloads
|
||||||
|
cypress/snapshots/*/__diff_output__
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
6
packages/editor/cypress.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"video": false,
|
||||||
|
"videoUploadOnPasses": false,
|
||||||
|
"baseUrl": "http://localhost:8081"
|
||||||
|
}
|
||||||
|
|
22
packages/editor/cypress/integration/playground.test.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
context('Playground', () => {
|
||||||
|
it('viewmode page should match its snapshot', () => {
|
||||||
|
['welcome', 'sample1', 'sample2', 'sample3', 'sample4', 'sample5', 'sample6', 'complex', 'img-support', 'icon-sample'].forEach((mapId) => {
|
||||||
|
cy.visit(`/viewmode.html?id=${mapId}`);
|
||||||
|
cy.get('#mindplot.ready').should('exist');
|
||||||
|
cy.matchImageSnapshot(`viewmode-${mapId}`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('the playground container.html page should match its snapshot', () => {
|
||||||
|
cy.visit('/container.html');
|
||||||
|
cy.getIframeBody()
|
||||||
|
.find('#mindplot.ready')
|
||||||
|
.should('exist');
|
||||||
|
cy.matchImageSnapshot('container');
|
||||||
|
});
|
||||||
|
it('the playground editor.html page should match its snapshot', () => {
|
||||||
|
cy.visit('/editor.html');
|
||||||
|
cy.get('#mindplot.ready').should('exist');
|
||||||
|
// TODO: why is the editor appearing twice in the snapshot?
|
||||||
|
cy.matchImageSnapshot('editor');
|
||||||
|
});
|
||||||
|
});
|
24
packages/editor/cypress/plugins/index.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/// <reference types="cypress" />
|
||||||
|
// ***********************************************************
|
||||||
|
// This example plugins/index.js can be used to load plugins
|
||||||
|
//
|
||||||
|
// You can change the location of this file or turn off loading
|
||||||
|
// the plugins file with the 'pluginsFile' configuration option.
|
||||||
|
//
|
||||||
|
// You can read more here:
|
||||||
|
// https://on.cypress.io/plugins-guide
|
||||||
|
// ***********************************************************
|
||||||
|
|
||||||
|
// This function is called when a project is opened or re-opened (e.g. due to
|
||||||
|
// the project's config changing)
|
||||||
|
|
||||||
|
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {Cypress.PluginConfig}
|
||||||
|
*/
|
||||||
|
module.exports = (on, config) => {
|
||||||
|
// `on` is used to hook into various events Cypress emits
|
||||||
|
// `config` is the resolved Cypress config
|
||||||
|
addMatchImageSnapshotPlugin(on, config);
|
||||||
|
};
|
Before Width: | Height: | Size: 191 KiB After Width: | Height: | Size: 191 KiB |
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 118 KiB |
After Width: | Height: | Size: 185 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 137 KiB |
After Width: | Height: | Size: 103 KiB |
After Width: | Height: | Size: 114 KiB |
24
packages/editor/cypress/support/commands.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
|
||||||
|
|
||||||
|
// make matchImageSnapshot() call the real implementation only if CYPRESS_imageSnaphots is set
|
||||||
|
// otherwise it calls a noop
|
||||||
|
if (Cypress.env('imageSnaphots')) {
|
||||||
|
addMatchImageSnapshotCommand({
|
||||||
|
failureThreshold: 0.001,
|
||||||
|
failureThresholdType: 'percent',
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Cypress.Commands.add(
|
||||||
|
'matchImageSnapshot',
|
||||||
|
{
|
||||||
|
prevSubject: ['optional', 'element', 'window', 'document'],
|
||||||
|
},
|
||||||
|
() => Promise.resolve(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://www.cypress.io/blog/2020/02/12/working-with-iframes-in-cypress/
|
||||||
|
Cypress.Commands.add('getIframeBody', () => cy
|
||||||
|
.get('iframe')
|
||||||
|
.its('0.contentDocument.body').should('not.be.empty')
|
||||||
|
.then(cy.wrap));
|
20
packages/editor/cypress/support/index.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// ***********************************************************
|
||||||
|
// This example support/index.js is processed and
|
||||||
|
// loaded automatically before your test files.
|
||||||
|
//
|
||||||
|
// This is a great place to put global configuration and
|
||||||
|
// behavior that modifies Cypress.
|
||||||
|
//
|
||||||
|
// You can change the location of this file or turn off
|
||||||
|
// automatically serving support files with the
|
||||||
|
// 'supportFile' configuration option.
|
||||||
|
//
|
||||||
|
// You can read more here:
|
||||||
|
// https://on.cypress.io/configuration
|
||||||
|
// ***********************************************************
|
||||||
|
|
||||||
|
// Import commands.js using ES2015 syntax:
|
||||||
|
import './commands';
|
||||||
|
|
||||||
|
// Alternatively you can use CommonJS syntax:
|
||||||
|
// require('./commands')
|
Before Width: | Height: | Size: 62 B After Width: | Height: | Size: 62 B |
Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 379 B |
Before Width: | Height: | Size: 345 B After Width: | Height: | Size: 345 B |
Before Width: | Height: | Size: 484 B After Width: | Height: | Size: 484 B |
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 602 B After Width: | Height: | Size: 602 B |
Before Width: | Height: | Size: 516 B After Width: | Height: | Size: 516 B |
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 489 B |
Before Width: | Height: | Size: 793 B After Width: | Height: | Size: 793 B |
Before Width: | Height: | Size: 700 B After Width: | Height: | Size: 700 B |
Before Width: | Height: | Size: 782 B After Width: | Height: | Size: 782 B |
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 211 B |
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 289 B |
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 294 B After Width: | Height: | Size: 294 B |
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 287 B |
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 541 B |
Before Width: | Height: | Size: 710 B After Width: | Height: | Size: 710 B |
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
Before Width: | Height: | Size: 444 B After Width: | Height: | Size: 444 B |
Before Width: | Height: | Size: 918 B After Width: | Height: | Size: 918 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 748 B After Width: | Height: | Size: 748 B |
Before Width: | Height: | Size: 796 B After Width: | Height: | Size: 796 B |
Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 936 B |
Before Width: | Height: | Size: 894 B After Width: | Height: | Size: 894 B |
Before Width: | Height: | Size: 918 B After Width: | Height: | Size: 918 B |
Before Width: | Height: | Size: 896 B After Width: | Height: | Size: 896 B |
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 919 B |
Before Width: | Height: | Size: 917 B After Width: | Height: | Size: 917 B |
Before Width: | Height: | Size: 914 B After Width: | Height: | Size: 914 B |
Before Width: | Height: | Size: 671 B After Width: | Height: | Size: 671 B |
Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 672 B |
Before Width: | Height: | Size: 669 B After Width: | Height: | Size: 669 B |
Before Width: | Height: | Size: 651 B After Width: | Height: | Size: 651 B |
Before Width: | Height: | Size: 656 B After Width: | Height: | Size: 656 B |
Before Width: | Height: | Size: 671 B After Width: | Height: | Size: 671 B |
Before Width: | Height: | Size: 992 B After Width: | Height: | Size: 992 B |
Before Width: | Height: | Size: 855 B After Width: | Height: | Size: 855 B |
Before Width: | Height: | Size: 949 B After Width: | Height: | Size: 949 B |
Before Width: | Height: | Size: 905 B After Width: | Height: | Size: 905 B |
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 919 B |
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 784 B |
Before Width: | Height: | Size: 590 B After Width: | Height: | Size: 590 B |
Before Width: | Height: | Size: 629 B After Width: | Height: | Size: 629 B |
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 673 B |
Before Width: | Height: | Size: 667 B After Width: | Height: | Size: 667 B |
Before Width: | Height: | Size: 666 B After Width: | Height: | Size: 666 B |
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 734 B |
Before Width: | Height: | Size: 620 B After Width: | Height: | Size: 620 B |