diff options
Diffstat (limited to 'spec/frontend/drawio/drawio_editor_spec.js')
-rw-r--r-- | spec/frontend/drawio/drawio_editor_spec.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/frontend/drawio/drawio_editor_spec.js b/spec/frontend/drawio/drawio_editor_spec.js index d7d75922e1e..4d93908b757 100644 --- a/spec/frontend/drawio/drawio_editor_spec.js +++ b/spec/frontend/drawio/drawio_editor_spec.js @@ -1,6 +1,5 @@ import { launchDrawioEditor } from '~/drawio/drawio_editor'; import { - DRAWIO_EDITOR_URL, DRAWIO_FRAME_ID, DIAGRAM_BACKGROUND_COLOR, DRAWIO_IFRAME_TIMEOUT, @@ -8,6 +7,10 @@ import { } from '~/drawio/constants'; import { createAlert, VARIANT_SUCCESS } from '~/alert'; +const DRAWIO_EDITOR_URL = + 'https://embed.diagrams.net/?ui=sketch&noSaveBtn=1&saveAndExit=1&keepmodified=1&spin=1&embed=1&libraries=1&configure=1&proto=json&toSvg=1'; +const DRAWIO_EDITOR_ORIGIN = new URL(DRAWIO_EDITOR_URL).origin; + jest.mock('~/alert'); jest.useFakeTimers(); @@ -59,6 +62,7 @@ describe('drawio/drawio_editor', () => { updateDiagram: jest.fn(), }; drawioIFrameReceivedMessages = []; + gon.diagramsnet_url = DRAWIO_EDITOR_ORIGIN; }); afterEach(() => { @@ -356,7 +360,11 @@ describe('drawio/drawio_editor', () => { const TEST_FILENAME = 'diagram.drawio.svg'; beforeEach(() => { - launchDrawioEditor({ editorFacade, filename: TEST_FILENAME }); + launchDrawioEditor({ + editorFacade, + filename: TEST_FILENAME, + drawioUrl: DRAWIO_EDITOR_ORIGIN, + }); }); it('displays loading spinner in the draw.io editor', async () => { |