2021-12-02 00:41:56 +00:00
|
|
|
context('Playground', () => {
|
|
|
|
it('the playground layout page should match its snapshot', () => {
|
|
|
|
// TODO: check why this error is happening, and remove this handling
|
|
|
|
cy.on('uncaught:exception', (err) => {
|
|
|
|
expect(err.message).to.include('Prediction is incorrectly positioned');
|
|
|
|
return false;
|
|
|
|
});
|
2021-12-17 02:13:54 +00:00
|
|
|
cy.visit('/layout.html');
|
2021-12-02 00:41:56 +00:00
|
|
|
cy.matchImageSnapshot('layout');
|
|
|
|
});
|
2021-12-25 21:33:17 -08:00
|
|
|
it('viewmode page should match its snapshot', () => {
|
|
|
|
['welcome', 'sample1', 'sample2', 'sample3', 'sample4', 'sample5', 'sample6', 'complex', 'img-support'].forEach((mapId) => {
|
|
|
|
cy.visit(`/viewmode.html?id=${mapId}`);
|
|
|
|
cy.get('#mindplot.ready').should('exist');
|
|
|
|
cy.matchImageSnapshot(`viewmode-${mapId}`);
|
|
|
|
});
|
2021-12-02 00:41:56 +00:00
|
|
|
});
|
2021-12-05 09:25:16 -08:00
|
|
|
it('the playground container.html page should match its snapshot', () => {
|
2021-12-17 02:13:54 +00:00
|
|
|
cy.visit('/container.html');
|
2021-12-21 18:05:03 +00:00
|
|
|
cy.getIframeBody()
|
|
|
|
.find('#mindplot.ready')
|
|
|
|
.should('exist');
|
2021-12-05 09:25:16 -08:00
|
|
|
cy.matchImageSnapshot('container');
|
|
|
|
});
|
|
|
|
it('the playground editor.html page should match its snapshot', () => {
|
2021-12-17 02:13:54 +00:00
|
|
|
cy.visit('/editor.html');
|
2021-12-21 18:05:03 +00:00
|
|
|
cy.get('#mindplot.ready').should('exist');
|
2021-12-05 09:25:16 -08:00
|
|
|
// TODO: why is the editor appearing twice in the snapshot?
|
|
|
|
cy.matchImageSnapshot('editor');
|
|
|
|
});
|
2021-12-02 00:41:56 +00:00
|
|
|
});
|