-
-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba5f523
commit aaaeac2
Showing
21 changed files
with
4,234 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"$schema": "https://on.cypress.io/cypress.schema.json", | ||
"baseUrl": "http:https://localhost:3000", | ||
"pluginsFile": "./cypress/plugins/index.cjs", | ||
"viewportWidth": 1440, | ||
"viewportHeight": 768, | ||
"snapshotFileName": "./cypress/snapshots.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"plugins": ["cypress"], | ||
"extends": ["plugin:cypress/recommended"], | ||
"rules": { | ||
"jest/expect-expect": "off" | ||
}, | ||
"env": { | ||
"cypress/globals": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
describe('Diagram updates when code is edited', () => { | ||
beforeEach(() => { | ||
cy.clearLocalStorage(); | ||
cy.visit('/'); | ||
}); | ||
it('Editor Test', () => { | ||
cy.get('#editor').type(' C --> Test'); | ||
cy.wrap(localStorage).snapshot(); | ||
// cy.get('#view > #container > svg').snapshot(); | ||
}); | ||
}); | ||
|
||
describe('Auto sync tests', () => { | ||
beforeEach(() => { | ||
cy.clearLocalStorage(); | ||
cy.visit('/'); | ||
}); | ||
it('should dim diagram when code is edited', () => { | ||
cy.contains('Auto sync').click(); | ||
cy.get('#view').should('not.have.class', 'outOfSync'); | ||
cy.get('#editor').type(' C --> Test'); | ||
cy.get('#view').should('have.class', 'outOfSync'); | ||
}); | ||
|
||
it('should show/hide sync button with auto sync', () => { | ||
cy.get('[data-cy=sync]').should('not.exist'); | ||
cy.contains('Auto sync').click(); | ||
cy.get('[data-cy=sync]').should('exist'); | ||
cy.get('#autoSync').check(); | ||
cy.get('[data-cy=sync]').should('not.exist'); | ||
}); | ||
it('should not dim diagram when code is in sync', () => { | ||
cy.contains('Auto sync').click(); | ||
cy.get('#view').should('not.have.class', 'outOfSync'); | ||
cy.get('#editor').type(' C --> Test'); | ||
cy.get('#view').should('have.class', 'outOfSync'); | ||
cy.get('[data-cy=sync]').click(); | ||
cy.get('#view').should('not.have.class', 'outOfSync'); | ||
cy.get('#autoSync').check(); | ||
cy.get('#editor').type('ing'); | ||
cy.get('#view').should('not.have.class', 'outOfSync'); | ||
cy.wrap(localStorage).snapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
describe('Site Loads', () => { | ||
beforeEach(() => { | ||
cy.clearLocalStorage(); | ||
}); | ||
it('Check Home page load', () => { | ||
cy.visit('/'); | ||
cy.url().should('include', '/edit'); | ||
cy.contains('History').click(); | ||
cy.wrap(localStorage).snapshot(); | ||
}); | ||
|
||
it('Check Redirect from old URL', () => { | ||
cy.visit( | ||
'/#/edit/eyJjb2RlIjoiZ3JhcGggVERcbiAgICBBW0NocmlzdG1hc10gLS0-fEdldCBtb25leXwgQihHbyBzaG9wcGluZylcbiAgICBCIC0tPiBDe0xldCBtZSB0aGlua31cbiAgICBDIC0tPnxPbmV8IERbTGFwdG9wXVxuICAgIEMgLS0-fFR3b3wgRVtpUGhvbmVdXG4gICAgQyAtLT58VGhyZWV8IEZbZmE6ZmEtY2FyIENhcl0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9LCJ1cGRhdGVFZGl0b3IiOmZhbHNlfQ' | ||
); | ||
cy.url().should( | ||
'include', | ||
'/edit/eyJjb2RlIjoiZ3JhcGggVERcbiAgICBBW0NocmlzdG1hc10gLS0-fEdldCBtb25leXwgQihHbyBzaG9wcGluZylcbiAgICBCIC0tPiBDe0xldCBtZSB0aGlua31cbiAgICBDIC0tPnxPbmV8IERbTGFwdG9wXVxuICAgIEMgLS0-fFR3b3wgRVtpUGhvbmVdXG4gICAgQyAtLT58VGhyZWV8IEZbZmE6ZmEtY2FyIENhcl0iLCJtZXJtYWlkIjp7InRoZW1lIjoiZGVmYXVsdCJ9LCJ1cGRhdGVFZGl0b3IiOmZhbHNlfQ' | ||
); | ||
|
||
cy.contains('History').click(); | ||
cy.wrap(localStorage).snapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/// <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) | ||
|
||
/** | ||
* @type {Cypress.PluginConfig} | ||
*/ | ||
// eslint-disable-next-line no-unused-vars | ||
import * as fs from 'fs'; | ||
|
||
module.exports = (on, config) => { | ||
on('task', { | ||
readFileMaybe(filename) { | ||
if (fs.existsSync(filename)) { | ||
return fs.readFileSync(filename, 'utf8'); | ||
} | ||
|
||
return null; | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module.exports = { | ||
"Site Loads": { | ||
"Check Home page load": { | ||
"1": { | ||
"manualHistoryStore": "[]", | ||
"autoHistoryMode": "false", | ||
"codeStore": "{\"code\":\"graph TD\\n A[Christmas] -->|Get money| B(Go shopping)\\n B --> C{Let me think}\\n C -->|One| D[Laptop]\\n C -->|Two| E[iPhone]\\n C -->|Three| F[fa:fa-car Car]\\n \",\"mermaid\":\"{\\n \\\"theme\\\": \\\"default\\\"\\n}\",\"updateEditor\":false,\"autoSync\":true,\"updateDiagram\":false}", | ||
"autoHistoryStore": "[]" | ||
} | ||
}, | ||
"Check Redirect from old URL": { | ||
"1": { | ||
"manualHistoryStore": "[]", | ||
"autoHistoryMode": "false", | ||
"codeStore": "{\"code\":\"graph TD\\n A[Christmas] -->|Get money| B(Go shopping)\\n B --> C{Let me think}\\n C -->|One| D[Laptop]\\n C -->|Two| E[iPhone]\\n C -->|Three| F[fa:fa-car Car]\",\"mermaid\":\"{\\n \\\"theme\\\": \\\"default\\\"\\n}\",\"updateEditor\":false,\"autoSync\":true,\"updateDiagram\":false}", | ||
"autoHistoryStore": "[]" | ||
} | ||
} | ||
}, | ||
"__version": "7.3.0", | ||
"Diagram updates when code is edited": { | ||
"Editor Test": { | ||
"1": { | ||
"manualHistoryStore": "[]", | ||
"autoHistoryMode": "false", | ||
"codeStore": "{\"code\":\"graph TD\\n A[Christmas] -->|Get money| B(Go shopping)\\n B --> C{Let me think}\\n C -->|One| D[Laptop]\\n C -->|Two| E[iPhone]\\n C -->|Three| F[fa:fa-car Car]\\n C --> Test\",\"mermaid\":\"{\\n \\\"theme\\\": \\\"default\\\"\\n}\",\"updateEditor\":false,\"autoSync\":true,\"updateDiagram\":false}", | ||
"autoHistoryStore": "[]" | ||
} | ||
} | ||
}, | ||
"Auto sync tests": { | ||
"should not dim diagram when code is in sync": { | ||
"1": { | ||
"manualHistoryStore": "[]", | ||
"autoHistoryMode": "false", | ||
"codeStore": "{\"code\":\"graph TD\\n A[Christmas] -->|Get money| B(Go shopping)\\n B --> C{Let me think}\\n C -->|One| D[Laptop]\\n C -->|Two| E[iPhone]\\n C -->|Three| F[fa:fa-car Car]\\n C --> Testing\",\"mermaid\":\"{\\n \\\"theme\\\": \\\"default\\\"\\n}\",\"updateEditor\":false,\"autoSync\":true,\"updateDiagram\":false}", | ||
"autoHistoryStore": "[]" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add('login', (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | ||
import * as snapshot from '@cypress/snapshot'; | ||
snapshot.register(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// *********************************************************** | ||
// 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') | ||
const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/; | ||
Cypress.on('uncaught:exception', (err) => { | ||
/* returning false here prevents Cypress from failing the test */ | ||
if (resizeObserverLoopErrRe.test(err.message)) { | ||
return false; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"types": ["cypress"] | ||
}, | ||
"include": ["**/*.*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
@import '@fontsource/fira-mono'; | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,5 @@ module.exports = { | |
}, | ||
variants: { | ||
extend: {} | ||
}, | ||
plugins: [require('@tailwindcss/forms')] | ||
} | ||
}; |
Oops, something went wrong.