From dd5fde387613a0fc87448ab6151e7729f2fe4c92 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Tue, 7 Feb 2023 19:53:39 -0800 Subject: [PATCH] shorten test --- e2etests/regression_test.go | 29 +- .../sequence-panic/dagre/board.exp.json | 327 ++++++++++++++++++ .../sequence-panic/dagre/sketch.exp.svg | 52 +++ .../sequence-panic/elk/board.exp.json | 327 ++++++++++++++++++ .../sequence-panic/elk/sketch.exp.svg | 52 +++ 5 files changed, 762 insertions(+), 25 deletions(-) create mode 100644 e2etests/testdata/regression/sequence-panic/dagre/board.exp.json create mode 100644 e2etests/testdata/regression/sequence-panic/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/regression/sequence-panic/elk/board.exp.json create mode 100644 e2etests/testdata/regression/sequence-panic/elk/sketch.exp.svg diff --git a/e2etests/regression_test.go b/e2etests/regression_test.go index 5bfdba3d5..24e5f52ad 100644 --- a/e2etests/regression_test.go +++ b/e2etests/regression_test.go @@ -478,33 +478,12 @@ class2: class without rows { script: ` shape: sequence_diagram -user.shape: person -router: handlers (router) -handler: handlers (handler function) -db -models +a -HTTP request: { - user -> router: sends request - - database transaction: { - handlers -> db: |md - fetches data from - (e.g. GET request) - | - - router -> models: |md - calls business logic of - (e.g. url schema validation) - | - - router -> db: |md - stores changed data in - (e.g. POST request) - | +group: { + inner_group: { + a -> b } - - router -> user: sends response } `, }, diff --git a/e2etests/testdata/regression/sequence-panic/dagre/board.exp.json b/e2etests/testdata/regression/sequence-panic/dagre/board.exp.json new file mode 100644 index 000000000..8f284a7bd --- /dev/null +++ b/e2etests/testdata/regression/sequence-panic/dagre/board.exp.json @@ -0,0 +1,327 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "handler", + "type": "rectangle", + "pos": { + "x": 24, + "y": 74 + }, + "width": 227, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "handlers (handler function)", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 182, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "db", + "type": "rectangle", + "pos": { + "x": 313, + "y": 74 + }, + "width": 150, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "db", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 18, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "HTTP request", + "type": "rectangle", + "pos": { + "x": 563, + "y": 74 + }, + "width": 150, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "HTTP request", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 91, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "HTTP request.handlers", + "type": "rectangle", + "pos": { + "x": 632, + "y": 254 + }, + "width": 12, + "height": 80, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 58, + "labelHeight": 21, + "zIndex": 2, + "level": 2 + } + ], + "connections": [ + { + "id": "(HTTP request.handlers -> db)[0]", + "src": "HTTP request.handlers", + "srcArrow": "none", + "srcLabel": "", + "dst": "db", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 632, + "y": 270 + }, + { + "x": 388, + "y": 270 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 4 + }, + { + "id": "(handler -- )[0]", + "src": "handler", + "srcArrow": "none", + "srcLabel": "", + "dst": "handler-lifeline-end-2166861706", + "dstArrow": "none", + "dstLabel": "", + "opacity": 1, + "strokeDash": 6, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 137.5, + "y": 140 + }, + { + "x": 137.5, + "y": 400 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 1 + }, + { + "id": "(db -- )[0]", + "src": "db", + "srcArrow": "none", + "srcLabel": "", + "dst": "db-lifeline-end-2675250554", + "dstArrow": "none", + "dstLabel": "", + "opacity": 1, + "strokeDash": 6, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 388, + "y": 140 + }, + { + "x": 388, + "y": 400 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 1 + }, + { + "id": "(HTTP request -- )[0]", + "src": "HTTP request", + "srcArrow": "none", + "srcLabel": "", + "dst": "HTTP request-lifeline-end-1968028819", + "dstArrow": "none", + "dstLabel": "", + "opacity": 1, + "strokeDash": 6, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 638, + "y": 140 + }, + { + "x": 638, + "y": 400 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 1 + } + ] +} diff --git a/e2etests/testdata/regression/sequence-panic/dagre/sketch.exp.svg b/e2etests/testdata/regression/sequence-panic/dagre/sketch.exp.svg new file mode 100644 index 000000000..078c1b080 --- /dev/null +++ b/e2etests/testdata/regression/sequence-panic/dagre/sketch.exp.svg @@ -0,0 +1,52 @@ + +handlers (handler function)dbHTTP request + + + \ No newline at end of file diff --git a/e2etests/testdata/regression/sequence-panic/elk/board.exp.json b/e2etests/testdata/regression/sequence-panic/elk/board.exp.json new file mode 100644 index 000000000..8f284a7bd --- /dev/null +++ b/e2etests/testdata/regression/sequence-panic/elk/board.exp.json @@ -0,0 +1,327 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "handler", + "type": "rectangle", + "pos": { + "x": 24, + "y": 74 + }, + "width": 227, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "handlers (handler function)", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 182, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "db", + "type": "rectangle", + "pos": { + "x": 313, + "y": 74 + }, + "width": 150, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "db", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 18, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "HTTP request", + "type": "rectangle", + "pos": { + "x": 563, + "y": 74 + }, + "width": 150, + "height": 66, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "HTTP request", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 91, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "HTTP request.handlers", + "type": "rectangle", + "pos": { + "x": 632, + "y": 254 + }, + "width": 12, + "height": 80, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 58, + "labelHeight": 21, + "zIndex": 2, + "level": 2 + } + ], + "connections": [ + { + "id": "(HTTP request.handlers -> db)[0]", + "src": "HTTP request.handlers", + "srcArrow": "none", + "srcLabel": "", + "dst": "db", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 632, + "y": 270 + }, + { + "x": 388, + "y": 270 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 4 + }, + { + "id": "(handler -- )[0]", + "src": "handler", + "srcArrow": "none", + "srcLabel": "", + "dst": "handler-lifeline-end-2166861706", + "dstArrow": "none", + "dstLabel": "", + "opacity": 1, + "strokeDash": 6, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 137.5, + "y": 140 + }, + { + "x": 137.5, + "y": 400 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 1 + }, + { + "id": "(db -- )[0]", + "src": "db", + "srcArrow": "none", + "srcLabel": "", + "dst": "db-lifeline-end-2675250554", + "dstArrow": "none", + "dstLabel": "", + "opacity": 1, + "strokeDash": 6, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 388, + "y": 140 + }, + { + "x": 388, + "y": 400 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 1 + }, + { + "id": "(HTTP request -- )[0]", + "src": "HTTP request", + "srcArrow": "none", + "srcLabel": "", + "dst": "HTTP request-lifeline-end-1968028819", + "dstArrow": "none", + "dstLabel": "", + "opacity": 1, + "strokeDash": 6, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 638, + "y": 140 + }, + { + "x": 638, + "y": 400 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 1 + } + ] +} diff --git a/e2etests/testdata/regression/sequence-panic/elk/sketch.exp.svg b/e2etests/testdata/regression/sequence-panic/elk/sketch.exp.svg new file mode 100644 index 000000000..078c1b080 --- /dev/null +++ b/e2etests/testdata/regression/sequence-panic/elk/sketch.exp.svg @@ -0,0 +1,52 @@ + +handlers (handler function)dbHTTP request + + + \ No newline at end of file