Compare commits

...

51 Commits

Author SHA1 Message Date
sidharthv96
8acc6c1c53 Update snapshots 2022-12-15 19:14:06 +00:00
sidharthv96
be1656b136 Update snapshots 2022-12-15 19:13:57 +00:00
sidharthv96
33c5ba02e6 Update snapshots 2022-12-15 19:13:47 +00:00
sidharthv96
1015516416 Update snapshots 2022-12-15 19:12:47 +00:00
sidharthv96
d475696534 Update snapshots 2022-12-15 19:09:19 +00:00
sidharthv96
f1634216c4 Update snapshots 2022-12-15 19:09:16 +00:00
Sidharth Vinod
2777ed24f2 Merge branch 'develop' into sidv/e2eCI
* develop: (44 commits)
  Update docs
  Add `workflow_dispatch` to lint.yml
  chore: update docs folder
  lint
  fix typescript error
  fix(docs): build the docs
  fix(docs): remove duplicate section
  chore(deps): update all non-major dependencies
  Update docs/misc/integrations.md
  Add links to github atom add-ons
  remove links from atom.io; add note Atom has been archived
  set svg role to 'graphics-document document'
  common function for a11y; add to renderAsync; + renderAsync spec
  feat: add links to theme listing
  fix cspell
  fix cspell
  fix lint
  refactor theming doc
  remove typeof
  use camelCase
  ...
2022-12-16 00:34:36 +05:30
Sidharth Vinod
579536a151 Pull before commit 2022-12-16 00:32:41 +05:30
Sidharth Vinod
d6fad1bbd8 Merge pull request #3890 from BD103/patch-1
Add links to theme listing
2022-12-16 00:24:15 +05:30
BD103
e2b05d3cf6 Update docs 2022-12-15 18:24:23 +00:00
BD103
1495baac2c Merge branch 'develop' into patch-1 2022-12-15 13:20:45 -05:00
Sidharth Vinod
ff7ed7f49f Merge branch 'develop' of https://github.com/mermaid-js/mermaid into develop
* 'develop' of https://github.com/mermaid-js/mermaid: (40 commits)
  lint
  fix typescript error
  fix(docs): build the docs
  fix(docs): remove duplicate section
  chore(deps): update all non-major dependencies
  Update docs/misc/integrations.md
  Add links to github atom add-ons
  remove links from atom.io; add note Atom has been archived
  set svg role to 'graphics-document document'
  common function for a11y; add to renderAsync; + renderAsync spec
  fix cspell
  fix cspell
  fix lint
  refactor theming doc
  remove typeof
  use camelCase
  make test title clearer
  update /docs
  add test for multi-line accDescr
  use MockedD3, spies in util insertTitle spec (remove MockD3)
  ...
2022-12-15 21:50:06 +05:30
Sidharth Vinod
333b974f10 Add workflow_dispatch to lint.yml 2022-12-15 21:50:00 +05:30
Sidharth Vinod
01039c574c Merge pull request #3914 from tommoor/patch-1
fix: Typescript error in usage
2022-12-15 21:45:06 +05:30
Sidharth Vinod
4e70f327c4 Merge pull request #3897 from weedySeaDragon/feat/3896_a11y-svg-role-graphics-doc-doc
feat: Set svg role to 'graphics-document document'
2022-12-15 21:42:08 +05:30
Sidharth Vinod
54bb2ef00e Merge pull request #3908 from Joxtacy/patch-1
fix(docs): remove duplicate section
2022-12-15 20:39:52 +05:30
BD103
992d1623a7 chore: update docs folder 2022-12-15 09:46:00 -05:00
Tom Moor
78dd03dcdb lint 2022-12-15 09:29:30 -05:00
Tom Moor
9f2d29b68b fix typescript error 2022-12-15 06:09:22 -08:00
Jesper Hasselquist
dfa1d26952 fix(docs): build the docs 2022-12-12 22:32:50 +09:00
Jesper Hasselquist
32fcea3bdd fix(docs): remove duplicate section
Remove duplicate `Return Type` section
2022-12-12 21:39:19 +09:00
renovate[bot]
a975c8c9cd chore(deps): update all non-major dependencies 2022-12-12 04:57:37 +00:00
Alois Klink
e97bef2ff7 Merge pull request #3899 from weedySeaDragon/docs/remove-atom-links
doc: remove links from atom.io; add note Atom has been archived
2022-12-11 00:12:59 +00:00
Ashley Engelund
e4c9aa198e Update docs/misc/integrations.md
Co-authored-by: Alois Klink <alois@aloisklink.com>
2022-12-10 13:47:01 -08:00
Ashley Engelund
76e9e07370 Add links to github atom add-ons
Co-authored-by: Alois Klink <alois@aloisklink.com>
2022-12-10 13:46:24 -08:00
Ashley Engelund (weedySeaDragon @ github)
de795a915e remove links from atom.io; add note Atom has been archived 2022-12-09 04:56:55 -08:00
Ashley Engelund (weedySeaDragon @ github)
e59b830d74 set svg role to 'graphics-document document' 2022-12-08 11:25:04 -08:00
sidharthv96
2c4443ec71 Update snapshots 2022-12-08 10:12:47 +00:00
Sidharth Vinod
638607da00 reduce failure threshold 2022-12-08 15:36:07 +05:30
sidharthv96
f3e1479c77 Update snapshots 2022-12-08 09:29:38 +00:00
Sidharth Vinod
bc5b9d3937 fix: CI write permissions 2022-12-08 14:54:03 +05:30
Sidharth Vinod
976585401c Upload ci snapshots 2022-12-08 14:22:48 +05:30
Sidharth Vinod
6694bca803 Add ssim:fast 2022-12-08 14:18:24 +05:30
Sidharth Vinod
2a7dc427ae Use ci snapshots 2022-12-08 14:13:25 +05:30
Sidharth Vinod
a3d8f1f8e4 Remove ssim:fast 2022-12-08 14:05:37 +05:30
Sidharth Vinod
688d671d2e Add pingfang font 2022-12-08 14:04:06 +05:30
Sidharth Vinod
b14b23a6af Use ssim fast algorithm 2022-12-08 13:07:23 +05:30
Sidharth Vinod
aa949b4ff6 Increase blur 2022-12-08 12:54:45 +05:30
Sidharth Vinod
e792bf5239 Add blur 2022-12-08 12:54:28 +05:30
Sidharth Vinod
a0d3b8c1fe Increase threshold 2022-12-07 17:22:57 +05:30
Sidharth Vinod
a86f831b3e Remove courier font 2022-12-07 16:24:09 +05:30
Sidharth Vinod
1c794ce619 Add courier font 2022-12-07 15:50:07 +05:30
Sidharth Vinod
86cab46cf0 Try SSIM 2022-12-07 15:07:08 +05:30
Sidharth Vinod
e6e02a9b70 Fix viewport size 2022-12-07 15:03:42 +05:30
Sidharth Vinod
f3a209badc Remove hardcoded width in tests 2022-12-07 14:01:52 +05:30
Sidharth Vinod
69e84b6731 Fix viewport size 2022-12-07 14:01:35 +05:30
Sidharth Vinod
58dca0afe3 add snapshots to repo 2022-12-07 13:26:33 +05:30
Sidharth Vinod
af1a7bea1f add snapshots to repo 2022-12-07 13:26:08 +05:30
Sidharth Vinod
af212331ef Merge remote-tracking branch 'origin/develop' into pr/BD103/3890
* origin/develop:
  fix: Fail docs:verify on non push events
2022-12-07 11:58:33 +05:30
Sidharth Vinod
f2a85eafac Merge remote-tracking branch 'origin/develop' into pr/BD103/3890
* origin/develop:
  chore: Update cspell
  Update docs
  fix: docs build command
  chore: Rebuild docs if linting fails
  chore: Format Mermaid.vue
  Made mermaidConfig a local variable so that it cannot be shared cross rendering.
  Fixed an issue that diagrams disappear from docs pages when switching themes or reloading pages
  Fixed the issue that theme-switch does not work on docs.
  Get base sha from PR
  Run doc lint only if files changed
  Run doc lint only if files changed
  Run doc lint only if files changed
  split lint docs action
  split lint docs action
  fix: File location
  fix(docs): Test auto commit
  fix(docs): Test auto commit
  fix(docs): Test auto commit
  chore: Update docs path
  chore: Auto build docs if only src/docs is changed
2022-12-07 11:50:45 +05:30
BD103
49ca2e3588 feat: add links to theme listing 2022-12-05 17:41:30 -05:00
368 changed files with 471 additions and 102 deletions

View File

@@ -3,7 +3,7 @@ name: E2E
on: [push, pull_request]
permissions:
contents: read
contents: write
jobs:
build:
@@ -28,15 +28,28 @@ jobs:
cache: pnpm
node-version: ${{ matrix.node-version }}
# Experiment with this step if we cannot check-in the snapshots to the repo.
# - name: Cache snapshots
# id: cache-snapshot
# uses: actions/cache@v3
# with:
# # npm cache files are stored in `~/.npm` on Linux/macOS
# path: ./cypress/snapshots
# key: ${{ runner.os }}-build-${env.GITHUB_REF}
# restore-keys: |
# ${{ runner.os }}-build-develop
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
id: cypress
uses: cypress-io/github-action@v4
# If CYPRESS_RECORD_KEY is set, run in parallel on all containers
# Otherwise (e.g. if running from fork), we run on a single container only
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
with:
start: pnpm run dev
browser: chrome
wait-on: 'http://localhost:9000'
# Disable recording if we don't have an API key
# e.g. if this action was run from a fork
@@ -44,3 +57,18 @@ jobs:
parallel: ${{ secrets.CYPRESS_RECORD_KEY != '' }}
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() && steps.cypress.conclusion == 'failure' }}
with:
name: error-snapshots
path: cypress/snapshots/**/__diff_output__/*
- name: Commit changes
uses: EndBug/add-and-commit@v9
if: ${{ github.event_name == 'push' }}
with:
message: 'Update snapshots'
add: 'cypress/snapshots/*'
pull: '--rebase --autostash'

View File

@@ -7,6 +7,7 @@ on:
- opened
- synchronize
- ready_for_review
workflow_dispatch:
permissions:
contents: write

2
.gitignore vendored
View File

@@ -26,7 +26,7 @@ Gemfile.lock
/.vs
cypress/screenshots/
cypress/snapshots/
cypress/snapshots-dev/
# eslint --cache file
.eslintcache

View File

@@ -52,6 +52,7 @@
"laganeckas",
"lintstagedrc",
"lucida",
"mansalva",
"matthieu",
"mdbook",
"mermerd",
@@ -76,6 +77,7 @@
"shiki",
"sidharth",
"sphinxcontrib",
"ssim",
"statediagram",
"stylis",
"substate",

View File

@@ -5,9 +5,17 @@ const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin')
module.exports = defineConfig({
projectId: 'n2sma2',
viewportWidth: 1440,
viewportHeight: 1024,
e2e: {
specPattern: 'cypress/integration/**/*.{js,jsx,ts,tsx}',
setupNodeEvents(on, config) {
on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args.push('--window-size=1440,1024', '--force-device-scale-factor=1');
}
return launchOptions;
});
addMatchImageSnapshotPlugin(on, config);
// copy any needed variables from process.env to config.env
config.env.useAppli = process.env.USE_APPLI ? true : false;

View File

@@ -136,6 +136,5 @@ export const urlSnapshotTest = (url, _options, api = false, validation) => {
export const renderGraph = (graphStr, options, api) => {
const url = mermaidUrl(graphStr, options, api);
cy.visit(url);
};

View File

@@ -117,7 +117,6 @@ describe('Configuration', () => {
});
it('should not taint the initial configuration when using multiple directives', () => {
const url = 'http://localhost:9000/regression/issue-1874.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('svg');

View File

@@ -1,14 +1,12 @@
describe('Rerendering', () => {
it('should be able to render after an error has occurred', () => {
const url = 'http://localhost:9000/render-after-error.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('#graphDiv').should('exist');
});
it('should be able to render and rerender a graph via API', () => {
const url = 'http://localhost:9000/rerender.html';
cy.viewport(1440, 1024);
cy.visit(url);
cy.get('#graph [id^=flowchart-A]').should('have.text', 'XMas');

View File

@@ -225,7 +225,10 @@ describe('Gantt diagram', () => {
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
expect(maxWidthValue).to.be.within(984 * 0.95, 984 * 1.05);
expect(maxWidthValue).to.be.within(
Cypress.config().viewportWidth * 0.95,
Cypress.config().viewportWidth * 1.05
);
});
});
@@ -269,7 +272,10 @@ describe('Gantt diagram', () => {
const width = parseFloat(svg.attr('width'));
// use within because the absolute value can be slightly different depending on the environment ±5%
// expect(height).to.be.within(484 * 0.95, 484 * 1.05);
expect(width).to.be.within(984 * 0.95, 984 * 1.05);
expect(width).to.be.within(
Cypress.config().viewportWidth * 0.95,
Cypress.config().viewportWidth * 1.05
);
expect(svg).to.not.have.attr('style');
});
});

View File

@@ -54,7 +54,10 @@ describe('Pie Chart', () => {
const style = svg.attr('style');
expect(style).to.match(/^max-width: [\d.]+px;$/);
const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join(''));
expect(maxWidthValue).to.eq(984);
expect(maxWidthValue).to.be.within(
Cypress.config().viewportWidth * 0.95,
Cypress.config().viewportWidth * 1.05
);
});
});
it('should render a pie diagram when useMaxWidth is false', () => {
@@ -68,10 +71,11 @@ describe('Pie Chart', () => {
{ pie: { useMaxWidth: false } }
);
cy.get('svg').should((svg) => {
// const height = parseFloat(svg.attr('height'));
const width = parseFloat(svg.attr('width'));
// expect(height).to.eq(450);
expect(width).to.eq(984);
expect(width).to.be.within(
Cypress.config().viewportWidth * 0.95,
Cypress.config().viewportWidth * 1.05
);
expect(svg).to.not.have.attr('style');
});
});

View File

@@ -1,32 +1,8 @@
<html>
<head>
<meta charset="utf-8" />
<!-- <meta charset="iso-8859-15"/> -->
<script src="./viewer.js" type="module"></script>
<!-- <link href="https://fonts.googleapis.com/css?family=Mansalva&display=swap" rel="stylesheet" /> -->
<link
href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap"
rel="stylesheet"
/>
<style>
body {
/* font-family: 'Mansalva', cursive;*/
/* font-family: 'Mansalva', cursive; */
/* font-family: 'arial'; */
/* font-family: "trebuchet ms", verdana, arial; */
}
/* div {
font-family: 'arial';
} */
/* .mermaid-main-font {
font-family: "trebuchet ms", verdana, arial;
font-family: var(--mermaid-font-family);
} */
/* :root {
--mermaid-font-family: '"trebuchet ms", verdana, arial';
--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive;
--mermaid-font-family: '"Lucida Console", Monaco, monospace';
} */
svg {
border: 2px solid darkred;
}
@@ -36,21 +12,5 @@
}
</style>
</head>
<body>
<!-- <script src="./mermaid.js"></script> -->
<script>
// Notice startOnLoad=false
// This prevents default handling in mermaid from render before the e2e logic is applied
// mermaid.initialize({
// startOnLoad: false,
// useMaxWidth: true,
// // "themeCSS": ":root { --mermaid-font-family: \"trebuchet ms\", verdana, arial;}",
// // fontFamily: '\"trebuchet ms\", verdana, arial;'
// // fontFamily: '"Comic Sans MS", "Comic Sans", cursive'
// // fontFamily: '"Mansalva", cursive',
// // fontFamily: '"Noto Sans SC", sans-serif'
// fontFamily: '"Noto Sans SC", sans-serif'
// });
</script>
</body>
<body></body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Some files were not shown because too many files have changed in this diff Show More