Merge branch 'develop' into bug/5059_fix_external_connection_after_updating_edges

This commit is contained in:
Sidharth Vinod 2024-01-19 12:46:17 +05:30 committed by GitHub
commit 95ebb4aaec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 90 additions and 114 deletions

View File

@ -9,8 +9,42 @@ permissions:
contents: read
jobs:
cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Cache snapshots
id: cache-snapshot
uses: actions/cache@v4
with:
save-always: true
path: ./cypress/snapshots
key: ${{ runner.os }}-snapshots
- name: Switch to base branch
if: ${{ steps.cache-snapshot.outputs.cache-hit != 'true' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event_name == 'merge_group' && github.event.merge_group.base.sha || 'develop' }}
- name: Cypress run
uses: cypress-io/github-action@v4
id: cypress-snapshot-gen
if: ${{ steps.cache-snapshot.outputs.cache-hit != 'true' }}
with:
start: pnpm run dev
wait-on: 'http://localhost:9000'
browser: chrome
e2e:
runs-on: ubuntu-latest
needs: cache
strategy:
fail-fast: false
matrix:
@ -27,6 +61,13 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Cache snapshots
id: cache-snapshot
uses: actions/cache/restore@v3
with:
path: ./cypress/snapshots
key: ${{ runner.os }}-snapshots
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
@ -38,6 +79,7 @@ jobs:
with:
start: pnpm run dev:coverage
wait-on: 'http://localhost:9000'
browser: chrome
# Disable recording if we don't have an API key
# e.g. if this action was run from a fork
record: ${{ secrets.CYPRESS_RECORD_KEY != '' }}
@ -46,6 +88,7 @@ jobs:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
VITEST_COVERAGE: true
CYPRESS_COMMIT: ${{ github.sha }}
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
# Run step only pushes to develop and pull_requests
@ -57,6 +100,7 @@ jobs:
fail_ci_if_error: false
verbose: true
token: 6845cc80-77ee-4e17-85a1-026cd95e0766
- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() && steps.cypress.conclusion == 'failure' }}

View File

@ -124,6 +124,7 @@
"sidharth",
"sidharthv",
"sphinxcontrib",
"ssim",
"startx",
"starty",
"statediagram",

View File

@ -6,10 +6,18 @@ const coverage = require('@cypress/code-coverage/task');
module.exports = defineConfig({
projectId: 'n2sma2',
viewportWidth: 1440,
viewportHeight: 1024,
e2e: {
specPattern: 'cypress/integration/**/*.{js,jsx,ts,tsx}',
specPattern: 'cypress/integration/**/*.{js,ts}',
setupNodeEvents(on, config) {
coverage(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

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

@ -245,7 +245,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
);
});
});
@ -285,11 +288,11 @@ describe('Gantt diagram', () => {
{ gantt: { useMaxWidth: false } }
);
cy.get('svg').should((svg) => {
// const height = parseFloat(svg.attr('height'));
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

@ -24,8 +24,14 @@
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
// import '@percy/cypress';
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command';
addMatchImageSnapshotCommand();
addMatchImageSnapshotCommand({
comparisonMethod: 'ssim',
failureThreshold: 0.01,
failureThresholdType: 'percent',
customDiffConfig: {
ssim: 'fast',
},
blur: 1,
});

View File

@ -377,7 +377,7 @@ importers:
version: 1.0.0-alpha.72(@algolia/client-search@4.19.1)(@types/node@18.17.5)(search-insights@2.7.0)
vitepress-plugin-search:
specifier: ^1.0.4-alpha.20
version: 1.0.4-alpha.20(flexsearch@0.7.31)(vitepress@1.0.0-alpha.72)(vue@3.3.8)
version: 1.0.4-alpha.20(flexsearch@0.7.31)(vitepress@1.0.0-alpha.72)(vue@3.4.15)
packages/mermaid-example-diagram:
dependencies:
@ -464,7 +464,7 @@ importers:
version: 1.1.0
unocss:
specifier: ^0.58.0
version: 0.58.0(postcss@8.4.31)(rollup@2.79.1)(vite@4.5.0)
version: 0.58.0(postcss@8.4.33)(rollup@2.79.1)(vite@4.5.0)
unplugin-vue-components:
specifier: ^0.26.0
version: 0.26.0(rollup@2.79.1)(vue@3.3.4)
@ -476,7 +476,7 @@ importers:
version: 0.17.0(vite@4.5.0)(workbox-build@7.0.0)(workbox-window@7.0.0)
vitepress:
specifier: 1.0.0-rc.39
version: 1.0.0-rc.39(@algolia/client-search@4.19.1)(@types/node@18.17.5)(postcss@8.4.31)(search-insights@2.7.0)(typescript@5.1.6)
version: 1.0.0-rc.39(@algolia/client-search@4.19.1)(@types/node@18.17.5)(postcss@8.4.33)(search-insights@2.7.0)(typescript@5.1.6)
workbox-window:
specifier: ^7.0.0
version: 7.0.0
@ -5593,7 +5593,7 @@ packages:
sirv: 2.0.3
dev: true
/@unocss/postcss@0.58.0(postcss@8.4.31):
/@unocss/postcss@0.58.0(postcss@8.4.33):
resolution: {integrity: sha512-2hAwLbfUFqysi8FN1cn3xkHy5GhLMlYy6W4NrAZ2ws7F2MKpsCT2xCj7dT5cI2tW8ulD2YoVbKH15dBhNsMNUA==}
engines: {node: '>=14'}
peerDependencies:
@ -5605,7 +5605,7 @@ packages:
css-tree: 2.3.1
fast-glob: 3.3.2
magic-string: 0.30.5
postcss: 8.4.31
postcss: 8.4.33
dev: true
/@unocss/preset-attributify@0.58.0:
@ -5876,15 +5876,6 @@ packages:
estree-walker: 2.0.2
source-map-js: 1.0.2
/@vue/compiler-core@3.3.8:
resolution: {integrity: sha512-hN/NNBUECw8SusQvDSqqcVv6gWq8L6iAktUR0UF3vGu2OhzRqcOiAno0FmBJWwxhYEXRlQJT5XnoKsVq1WZx4g==}
dependencies:
'@babel/parser': 7.23.5
'@vue/shared': 3.3.8
estree-walker: 2.0.2
source-map-js: 1.0.2
dev: true
/@vue/compiler-core@3.4.15:
resolution: {integrity: sha512-XcJQVOaxTKCnth1vCxEChteGuwG6wqnUHxAm1DO3gCz0+uXKaJNx8/digSz4dLALCy8n2lKq24jSUs8segoqIw==}
dependencies:
@ -5901,13 +5892,6 @@ packages:
'@vue/compiler-core': 3.3.4
'@vue/shared': 3.3.4
/@vue/compiler-dom@3.3.8:
resolution: {integrity: sha512-+PPtv+p/nWDd0AvJu3w8HS0RIm/C6VGBIRe24b9hSyNWOAPEUosFZ5diwawwP8ip5sJ8n0Pe87TNNNHnvjs0FQ==}
dependencies:
'@vue/compiler-core': 3.3.8
'@vue/shared': 3.3.8
dev: true
/@vue/compiler-dom@3.4.15:
resolution: {integrity: sha512-wox0aasVV74zoXyblarOM3AZQz/Z+OunYcIHe1OsGclCHt8RsRm04DObjefaI82u6XDzv+qGWZ24tIsRAIi5MQ==}
dependencies:
@ -5929,21 +5913,6 @@ packages:
postcss: 8.4.31
source-map-js: 1.0.2
/@vue/compiler-sfc@3.3.8:
resolution: {integrity: sha512-WMzbUrlTjfYF8joyT84HfwwXo+8WPALuPxhy+BZ6R4Aafls+jDBnSz8PDz60uFhuqFbl3HxRfxvDzrUf3THwpA==}
dependencies:
'@babel/parser': 7.23.5
'@vue/compiler-core': 3.3.8
'@vue/compiler-dom': 3.3.8
'@vue/compiler-ssr': 3.3.8
'@vue/reactivity-transform': 3.3.8
'@vue/shared': 3.3.8
estree-walker: 2.0.2
magic-string: 0.30.5
postcss: 8.4.31
source-map-js: 1.0.2
dev: true
/@vue/compiler-sfc@3.4.15:
resolution: {integrity: sha512-LCn5M6QpkpFsh3GQvs2mJUOAlBQcCco8D60Bcqmf3O3w5a+KWS5GvYbrrJBkgvL1BDnTp+e8q0lXCLgHhKguBA==}
dependencies:
@ -5964,13 +5933,6 @@ packages:
'@vue/compiler-dom': 3.3.4
'@vue/shared': 3.3.4
/@vue/compiler-ssr@3.3.8:
resolution: {integrity: sha512-hXCqQL/15kMVDBuoBYpUnSYT8doDNwsjvm3jTefnXr+ytn294ySnT8NlsFHmTgKNjwpuFy7XVV8yTeLtNl/P6w==}
dependencies:
'@vue/compiler-dom': 3.3.8
'@vue/shared': 3.3.8
dev: true
/@vue/compiler-ssr@3.4.15:
resolution: {integrity: sha512-1jdeQyiGznr8gjFDadVmOJqZiLNSsMa5ZgqavkPZ8O2wjHv0tVuAEsw5hTdUoUW4232vpBbL/wJhzVW/JwY1Uw==}
dependencies:
@ -5994,27 +5956,11 @@ packages:
estree-walker: 2.0.2
magic-string: 0.30.5
/@vue/reactivity-transform@3.3.8:
resolution: {integrity: sha512-49CvBzmZNtcHua0XJ7GdGifM8GOXoUMOX4dD40Y5DxI3R8OUhMlvf2nvgUAcPxaXiV5MQQ1Nwy09ADpnLQUqRw==}
dependencies:
'@babel/parser': 7.23.5
'@vue/compiler-core': 3.3.8
'@vue/shared': 3.3.8
estree-walker: 2.0.2
magic-string: 0.30.5
dev: true
/@vue/reactivity@3.3.4:
resolution: {integrity: sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==}
dependencies:
'@vue/shared': 3.3.4
/@vue/reactivity@3.3.8:
resolution: {integrity: sha512-ctLWitmFBu6mtddPyOKpHg8+5ahouoTCRtmAHZAXmolDtuZXfjL2T3OJ6DL6ezBPQB1SmMnpzjiWjCiMYmpIuw==}
dependencies:
'@vue/shared': 3.3.8
dev: true
/@vue/reactivity@3.4.15:
resolution: {integrity: sha512-55yJh2bsff20K5O84MxSvXKPHHt17I2EomHznvFiJCAZpJTNW8IuLj1xZWMLELRhBK3kkFV/1ErZGHJfah7i7w==}
dependencies:
@ -6027,13 +5973,6 @@ packages:
'@vue/reactivity': 3.3.4
'@vue/shared': 3.3.4
/@vue/runtime-core@3.3.8:
resolution: {integrity: sha512-qurzOlb6q26KWQ/8IShHkMDOuJkQnQcTIp1sdP4I9MbCf9FJeGVRXJFr2mF+6bXh/3Zjr9TDgURXrsCr9bfjUw==}
dependencies:
'@vue/reactivity': 3.3.8
'@vue/shared': 3.3.8
dev: true
/@vue/runtime-core@3.4.15:
resolution: {integrity: sha512-6E3by5m6v1AkW0McCeAyhHTw+3y17YCOKG0U0HDKDscV4Hs0kgNT5G+GCHak16jKgcCDHpI9xe5NKb8sdLCLdw==}
dependencies:
@ -6048,14 +5987,6 @@ packages:
'@vue/shared': 3.3.4
csstype: 3.1.2
/@vue/runtime-dom@3.3.8:
resolution: {integrity: sha512-Noy5yM5UIf9UeFoowBVgghyGGPIDPy1Qlqt0yVsUdAVbqI8eeMSsTqBtauaEoT2UFXUk5S64aWVNJN4MJ2vRdA==}
dependencies:
'@vue/runtime-core': 3.3.8
'@vue/shared': 3.3.8
csstype: 3.1.2
dev: true
/@vue/runtime-dom@3.4.15:
resolution: {integrity: sha512-EVW8D6vfFVq3V/yDKNPBFkZKGMFSvZrUQmx196o/v2tHKdwWdiZjYUBS+0Ez3+ohRyF8Njwy/6FH5gYJ75liUw==}
dependencies:
@ -6073,16 +6004,6 @@ packages:
'@vue/shared': 3.3.4
vue: 3.3.4
/@vue/server-renderer@3.3.8(vue@3.3.8):
resolution: {integrity: sha512-zVCUw7RFskvPuNlPn/8xISbrf0zTWsTSdYTsUTN1ERGGZGVnRxM2QZ3x1OR32+vwkkCm0IW6HmJ49IsPm7ilLg==}
peerDependencies:
vue: 3.3.8
dependencies:
'@vue/compiler-ssr': 3.3.8
'@vue/shared': 3.3.8
vue: 3.3.8(typescript@5.0.4)
dev: true
/@vue/server-renderer@3.4.15(vue@3.4.15):
resolution: {integrity: sha512-3HYzaidu9cHjrT+qGUuDhFYvF/j643bHC6uUN9BgM11DVy+pM6ATsG6uPBLnkwOgs7BpJABReLmpL3ZPAsUaqw==}
peerDependencies:
@ -6090,16 +6011,12 @@ packages:
dependencies:
'@vue/compiler-ssr': 3.4.15
'@vue/shared': 3.4.15
vue: 3.4.15(typescript@5.1.6)
vue: 3.4.15(typescript@5.0.4)
dev: true
/@vue/shared@3.3.4:
resolution: {integrity: sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==}
/@vue/shared@3.3.8:
resolution: {integrity: sha512-8PGwybFwM4x8pcfgqEQFy70NaQxASvOC5DJwLQfpArw1UDfUXrJkdxD3BhVTMS+0Lef/TU7YO0Jvr0jJY8T+mw==}
dev: true
/@vue/shared@3.4.15:
resolution: {integrity: sha512-KzfPTxVaWfB+eGcGdbSf4CWdaXcGDqckoeXUh7SB3fZdEtzPCK2Vq9B/lRRL3yutax/LWITz+SwvgyOxz5V75g==}
dev: true
@ -16175,7 +16092,7 @@ packages:
engines: {node: '>= 10.0.0'}
dev: true
/unocss@0.58.0(postcss@8.4.31)(rollup@2.79.1)(vite@4.5.0):
/unocss@0.58.0(postcss@8.4.33)(rollup@2.79.1)(vite@4.5.0):
resolution: {integrity: sha512-MSPRHxBqWN+1AHGV+J5uUy4//e6ZBK6O+ISzD0qrXcCD/GNtxk1+lYjOK2ltkUiKX539+/KF91vNxzhhwEf+xA==}
engines: {node: '>=14'}
peerDependencies:
@ -16191,7 +16108,7 @@ packages:
'@unocss/cli': 0.58.0(rollup@2.79.1)
'@unocss/core': 0.58.0
'@unocss/extractor-arbitrary-variants': 0.58.0
'@unocss/postcss': 0.58.0(postcss@8.4.31)
'@unocss/postcss': 0.58.0(postcss@8.4.33)
'@unocss/preset-attributify': 0.58.0
'@unocss/preset-icons': 0.58.0
'@unocss/preset-mini': 0.58.0
@ -16530,7 +16447,7 @@ packages:
fsevents: 2.3.3
dev: true
/vitepress-plugin-search@1.0.4-alpha.20(flexsearch@0.7.31)(vitepress@1.0.0-alpha.72)(vue@3.3.8):
/vitepress-plugin-search@1.0.4-alpha.20(flexsearch@0.7.31)(vitepress@1.0.0-alpha.72)(vue@3.4.15):
resolution: {integrity: sha512-zG+ev9pw1Mg7htABlFCNXb8XwnKN+qfTKw+vU0Ers6RIrABx+45EAAFBoaL1mEpl1FRFn1o/dQ7F4b8GP6HdGQ==}
engines: {node: ^14.13.1 || ^16.7.0 || >=18}
peerDependencies:
@ -16544,7 +16461,7 @@ packages:
glob-to-regexp: 0.4.1
markdown-it: 13.0.1
vitepress: 1.0.0-alpha.72(@algolia/client-search@4.19.1)(@types/node@18.17.5)(search-insights@2.7.0)
vue: 3.3.8(typescript@5.0.4)
vue: 3.4.15(typescript@5.0.4)
dev: true
/vitepress@1.0.0-alpha.72(@algolia/client-search@4.19.1)(@types/node@18.17.5)(search-insights@2.7.0):
@ -16578,7 +16495,7 @@ packages:
- terser
dev: true
/vitepress@1.0.0-rc.39(@algolia/client-search@4.19.1)(@types/node@18.17.5)(postcss@8.4.31)(search-insights@2.7.0)(typescript@5.1.6):
/vitepress@1.0.0-rc.39(@algolia/client-search@4.19.1)(@types/node@18.17.5)(postcss@8.4.33)(search-insights@2.7.0)(typescript@5.1.6):
resolution: {integrity: sha512-EcgoRlAAp37WOxUOYv45oxyhLrcy3Upey+mKpqW3ldsg6Ol4trPndRBk2GO0QiSvEKlb9BMerk49D/bFICN6kg==}
hasBin: true
peerDependencies:
@ -16600,7 +16517,7 @@ packages:
focus-trap: 7.5.4
mark.js: 8.11.1
minisearch: 6.3.0
postcss: 8.4.31
postcss: 8.4.33
shikiji: 0.9.19
shikiji-core: 0.9.19
shikiji-transformers: 0.9.19
@ -16788,19 +16705,19 @@ packages:
'@vue/server-renderer': 3.3.4(vue@3.3.4)
'@vue/shared': 3.3.4
/vue@3.3.8(typescript@5.0.4):
resolution: {integrity: sha512-5VSX/3DabBikOXMsxzlW8JyfeLKlG9mzqnWgLQLty88vdZL7ZJgrdgBOmrArwxiLtmS+lNNpPcBYqrhE6TQW5w==}
/vue@3.4.15(typescript@5.0.4):
resolution: {integrity: sha512-jC0GH4KkWLWJOEQjOpkqU1bQsBwf4R1rsFtw5GQJbjHVKWDzO6P0nWWBTmjp1xSemAioDFj1jdaK1qa3DnMQoQ==}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@vue/compiler-dom': 3.3.8
'@vue/compiler-sfc': 3.3.8
'@vue/runtime-dom': 3.3.8
'@vue/server-renderer': 3.3.8(vue@3.3.8)
'@vue/shared': 3.3.8
'@vue/compiler-dom': 3.4.15
'@vue/compiler-sfc': 3.4.15
'@vue/runtime-dom': 3.4.15
'@vue/server-renderer': 3.4.15(vue@3.4.15)
'@vue/shared': 3.4.15
typescript: 5.0.4
dev: true