From e37f5a6eb2bf5bfa5cddbec11032ff0d19c04d37 Mon Sep 17 00:00:00 2001 From: knsv Date: Sun, 8 Sep 2019 02:56:06 -0700 Subject: [PATCH] #926 Applying the color styling on the label instead of the node --- e2e/README.md | 20 ++++++++++++++- e2e/platform/e2e.html | 2 ++ e2e/platform/viewer.js | 3 ++- ...nder-a-simple-sequence-diagrams-1-diff.png | Bin 59408 -> 0 bytes ...ld-render-color-of-styled-nodes-1-snap.png | Bin 0 -> 5023 bytes e2e/spec/flowchart.spec.js | 9 ++++--- src/diagrams/flowchart/flowRenderer.js | 23 ++++++++++++------ 7 files changed, 44 insertions(+), 13 deletions(-) delete mode 100644 e2e/spec/__image_snapshots__/__diff_output__/xss-spec-js-sequencediagram-should-render-a-simple-sequence-diagrams-1-diff.png create mode 100644 e2e/spec/__image_snapshots__/flowchart-spec-js-flowcart-should-render-color-of-styled-nodes-1-snap.png diff --git a/e2e/README.md b/e2e/README.md index e6a96cb28..ef701dd66 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -4,6 +4,16 @@ These tests are end to end tests in the sense that they actually render a full d Apart from beeing rendered in a browser the tests perform image snapshots of the diagrams. The tests is handled in the same way as regular jest snapshots tests with the difference that an image comparison is performed instead of a comparison of the generated code. +# Platform differences + +There will be slightly different renderings of the images on different platforms. For instance how fonts are anti-aliased. This means that until this started to render usings some common clod service the snaphos rendered on windows will fail in linux etc. + +Here are a few simple rules to work around this flaw for now: + +1. With no changes assume that tests are working. +2. Before starting to do changes update the snapshots `jest e2e --config e2e/jest.config.js -u` +3. Dont commit the __diff_output__ + ## To run the tests 1. Start the dev server by running ***yarn dev*** 2. Run yarn e2e to run the tests @@ -31,4 +41,12 @@ Add otions for the e2e tests to log the dev server url as in the example below. Open the url in the dev server and fix the issue. -This way if working makes it easy to have render a graph you want to work with ands ensures that the e2e suit is expanded. \ No newline at end of file +This way if working makes it easy to have render a graph you want to work with ands ensures that the e2e suit is expanded. + +One unwanted sideeffect is that when the fix is done the the likley willl fail. Fix this by updating the snapshots. + +``` + jest e2e --config e2e/jest.config.js -u +``` + +** Important** If you change the text, dont forget to use the new url. \ No newline at end of file diff --git a/e2e/platform/e2e.html b/e2e/platform/e2e.html index bed932e80..498b374d2 100644 --- a/e2e/platform/e2e.html +++ b/e2e/platform/e2e.html @@ -10,6 +10,8 @@