Replace Rose::CodeEditor with Hds::CodeEditor (#2679)
* chore: 🤖 replace Rose::CodeEditor with Hds::CodeEditor - Remove CodeEditor 5 dependency * chore: 🤖 Replace CodeMirror5 dep remove CodeMirror5 and replace existing editors with HDS::CodeEditor * chore: 🤖 deleting old codeeditor styles * feat: 🎸 changing code editor changing code editor ✅ Closes: 0 * removed unused export * pr cleanup * updating tests for new code editor * responding to PR feedback * added whitespace * fixing linting violations * chore: 🤖 self-review PR self-review PR in the course of switching to new HDS code editor * fix: 🐛 fix linting bug * fix: 🐛 unneeded dependency remove jslint dependency as this is handled in the new code editor from HDS * fix: 🐛 Fixing import bug Fix import bug caused by importing scss modules that no longer exist * Fix and refactor code editor acceptance test * Fix and refactor code editor acceptance test * chore: 🤖 remove codemirror dependency * refactor: 💡 fix merge conflict issues * test: 💍 update e2e test selectors * test: 💍 fix target spec click event * refactor: 💡 clean up test selectors for code editor * refactor: 💡 clean up storage bucket test selectors * chore: 🤖 remove code mirror modifiers --------- Co-authored-by: calcaide <ccorvo@hashicorp.com> Co-authored-by: cameronperera <cameron.perera@hashicorp.com>
This commit is contained in:
1 parent
fd1eba617b
commit
d469f305de
41 files changed
+354
-744
No files matched your search
+38
-5
@@ -4,7 +4,14 @@
|
||||
*/
|
||||
|
||||
import { module, test } from 'qunit';
|
||||
import { visit, currentURL, click, fillIn } from '@ember/test-helpers';
|
||||
import {
|
||||
visit,
|
||||
currentURL,
|
||||
click,
|
||||
fillIn,
|
||||
find,
|
||||
waitFor,
|
||||
} from '@ember/test-helpers';
|
||||
import { setupApplicationTest } from 'admin/tests/helpers';
|
||||
import { setupSqlite } from 'api/test-support/helpers/sqlite';
|
||||
import { Response } from 'miragejs';
|
||||
@@ -23,7 +30,6 @@ module(
|
||||
|
||||
const FIELD_BUCKET_NAME = '[name="bucket_name"]';
|
||||
const FIELD_BUCKET_PREFIX = '[name="bucket_prefix"]';
|
||||
const FIELD_EDITOR = '[data-test-code-editor-field-editor] textarea';
|
||||
const WORKER_FILTER_VALUE = '"dev" in "/tags/env"';
|
||||
const FIELD_SCOPE = (scope) => `[value="${scope}"]`;
|
||||
|
||||
@@ -90,7 +96,16 @@ module(
|
||||
commonSelectors.FIELD_NAME_VALUE,
|
||||
);
|
||||
await click(FIELD_SCOPE('global'));
|
||||
await fillIn(FIELD_EDITOR, WORKER_FILTER_VALUE);
|
||||
await waitFor(commonSelectors.CODE_EDITOR_CM);
|
||||
|
||||
const editorElement = find(commonSelectors.CODE_EDITOR_CODE);
|
||||
const editorView = editorElement.editor;
|
||||
editorView.dispatch({
|
||||
changes: {
|
||||
from: editorView.state.selection.main.from,
|
||||
insert: WORKER_FILTER_VALUE,
|
||||
},
|
||||
});
|
||||
|
||||
assert.dom(FIELD_BUCKET_NAME).isNotDisabled();
|
||||
assert.dom(FIELD_BUCKET_PREFIX).isNotDisabled();
|
||||
@@ -131,7 +146,16 @@ module(
|
||||
commonSelectors.FIELD_NAME_VALUE,
|
||||
);
|
||||
await click(FIELD_SCOPE(instances.scopes.org.scope.id));
|
||||
await fillIn(FIELD_EDITOR, WORKER_FILTER_VALUE);
|
||||
await waitFor(commonSelectors.CODE_EDITOR_CM);
|
||||
|
||||
const editorElement = find(commonSelectors.CODE_EDITOR_CODE);
|
||||
const editorView = editorElement.editor;
|
||||
editorView.dispatch({
|
||||
changes: {
|
||||
from: editorView.state.selection.main.from,
|
||||
insert: WORKER_FILTER_VALUE,
|
||||
},
|
||||
});
|
||||
|
||||
assert.dom(FIELD_BUCKET_NAME).isNotDisabled();
|
||||
assert.dom(FIELD_BUCKET_PREFIX).isNotDisabled();
|
||||
@@ -216,7 +240,16 @@ module(
|
||||
await visit(urls.enableSessionRecording);
|
||||
|
||||
await click(commonSelectors.HREF(urls.newStorageBucket));
|
||||
await fillIn(FIELD_EDITOR, WORKER_FILTER_VALUE);
|
||||
await waitFor(commonSelectors.CODE_EDITOR_CM);
|
||||
|
||||
const editorElement = find(commonSelectors.CODE_EDITOR_CODE);
|
||||
const editorView = editorElement.editor;
|
||||
editorView.dispatch({
|
||||
changes: {
|
||||
from: editorView.state.selection.main.from,
|
||||
insert: WORKER_FILTER_VALUE,
|
||||
},
|
||||
});
|
||||
await click(commonSelectors.SAVE_BTN);
|
||||
|
||||
assert.dom(commonSelectors.ALERT_TOAST_BODY).hasText(errorMessage);
|
||||
|
||||
Reference in new issue
Block a user