summaryrefslogtreecommitdiff
path: root/spec/frontend_integration/ide/helpers/ide_helper.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend_integration/ide/helpers/ide_helper.js')
-rw-r--r--spec/frontend_integration/ide/helpers/ide_helper.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/frontend_integration/ide/helpers/ide_helper.js b/spec/frontend_integration/ide/helpers/ide_helper.js
index 56b2e298aa3..54a522324f5 100644
--- a/spec/frontend_integration/ide/helpers/ide_helper.js
+++ b/spec/frontend_integration/ide/helpers/ide_helper.js
@@ -192,6 +192,13 @@ export const commit = async ({ newBranch = false, newMR = false, newBranchName =
switchLeftSidebarTab('Commit');
screen.getByTestId('begin-commit-button').click();
+ await waitForMonacoEditor();
+
+ const mrCheck = await screen.findByLabelText('Start a new merge request');
+ if (Boolean(mrCheck.checked) !== newMR) {
+ mrCheck.click();
+ }
+
if (!newBranch) {
const option = await screen.findByLabelText(/Commit to .+ branch/);
option.click();
@@ -201,12 +208,9 @@ export const commit = async ({ newBranch = false, newMR = false, newBranchName =
const branchNameInput = await screen.findByTestId('ide-new-branch-name');
fireEvent.input(branchNameInput, { target: { value: newBranchName } });
-
- const mrCheck = await screen.findByLabelText('Start a new merge request');
- if (Boolean(mrCheck.checked) !== newMR) {
- mrCheck.click();
- }
}
screen.getByText('Commit').click();
+
+ await waitForMonacoEditor();
};