diff options
Diffstat (limited to 'spec/frontend_integration/ide/helpers/ide_helper.js')
-rw-r--r-- | spec/frontend_integration/ide/helpers/ide_helper.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/frontend_integration/ide/helpers/ide_helper.js b/spec/frontend_integration/ide/helpers/ide_helper.js index 8d5d047b146..9e6bafc1297 100644 --- a/spec/frontend_integration/ide/helpers/ide_helper.js +++ b/spec/frontend_integration/ide/helpers/ide_helper.js @@ -69,7 +69,7 @@ const openFileRow = (row) => { row.click(); }; -const findAndTraverseToPath = async (path, index = 0, row = null) => { +export const findAndTraverseToPath = async (path, index = 0, row = null) => { if (!path) { return row; } @@ -110,6 +110,12 @@ const findAndClickRootAction = async (name) => { button.click(); }; +/** + * Drop leading "/-/ide" and file path from the current URL + */ +export const getBaseRoute = (url = window.location.pathname) => + url.replace(/^\/-\/ide/, '').replace(/\/-\/.*$/, ''); + export const clickPreviewMarkdown = () => { screen.getByText('Preview Markdown').click(); }; |