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
@@ -145,7 +145,10 @@ export class TargetsPage extends BaseResourcePage {
|
||||
.getByText('Edit Ingress Worker Filter'),
|
||||
).toBeVisible();
|
||||
|
||||
await this.page.locator('.CodeMirror').getByRole('textbox').fill(filter);
|
||||
await this.page
|
||||
.locator('.hds-code-editor')
|
||||
.getByRole('textbox')
|
||||
.fill(filter);
|
||||
|
||||
await this.page.getByRole('button', { name: 'Save', exact: true }).click();
|
||||
await this.dismissSuccessAlert();
|
||||
@@ -174,7 +177,10 @@ export class TargetsPage extends BaseResourcePage {
|
||||
.getByText('Edit Egress Worker Filter'),
|
||||
).toBeVisible();
|
||||
|
||||
await this.page.locator('.CodeMirror').getByRole('textbox').fill(filter);
|
||||
await this.page
|
||||
.locator('.hds-code-editor')
|
||||
.getByRole('textbox')
|
||||
.fill(filter);
|
||||
|
||||
await this.page.getByRole('button', { name: 'Save', exact: true }).click();
|
||||
await this.dismissSuccessAlert();
|
||||
|
||||
@@ -195,7 +195,9 @@ test(
|
||||
await page.getByLabel('Description').fill('This is an automated test');
|
||||
await page.getByRole('combobox', { name: 'Type' }).click();
|
||||
await page.getByRole('option', { name: 'JSON' }).click();
|
||||
await page.getByText('{}').click();
|
||||
await page.locator('.hds-code-editor').getByRole('textbox').click();
|
||||
// Move cursor to middle of '{}' to avoid typing outside of the braces
|
||||
await page.keyboard.press('ArrowLeft');
|
||||
const testName = 'name-json';
|
||||
const testPassword = 'password-json';
|
||||
const testId = 'id-json';
|
||||
|
||||
@@ -233,19 +233,16 @@ test(
|
||||
).toBeVisible();
|
||||
await expect(page.getByText('"dev" in "/tags/type"')).toBeVisible();
|
||||
|
||||
await page
|
||||
.locator('.CodeMirror')
|
||||
.getByRole('textbox')
|
||||
.click({ force: true });
|
||||
await page.locator('.hds-code-editor').getByRole('textbox').click();
|
||||
await expect(
|
||||
page.locator('.CodeMirror').getByRole('textbox'),
|
||||
page.locator('.hds-code-editor').getByRole('textbox'),
|
||||
).toBeFocused();
|
||||
const selectAllShortcut =
|
||||
process.platform === 'darwin' ? 'Meta+A' : 'Control+A';
|
||||
await page.keyboard.press(selectAllShortcut);
|
||||
await page.keyboard.press('Backspace');
|
||||
await page
|
||||
.locator('.CodeMirror')
|
||||
.locator('.hds-code-editor')
|
||||
.getByRole('textbox')
|
||||
.fill('"prod" in "/tags/type"');
|
||||
await page.getByRole('button', { name: 'Save' }).click();
|
||||
|
||||
Reference in new issue
Block a user