Skip to content

Commit

Permalink
test: e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
r00gm committed Jan 15, 2025
1 parent f08905f commit 005ef5d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
7 changes: 5 additions & 2 deletions cypress/e2e/23-variables.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ describe('Variables', () => {
const editingRow = variablesPage.getters.variablesEditableRows().eq(0);
variablesPage.actions.setRowValue(editingRow, 'key', key);
variablesPage.actions.setRowValue(editingRow, 'value', value);
editingRow.should('contain', 'This field may contain only letters');
variablesPage.getters.editableRowSaveButton(editingRow).should('be.disabled');
variablesPage.actions.saveRowEditing(editingRow);
variablesPage.getters
.variablesEditableRows()
.eq(0)
.should('contain', 'This field may contain only letters');
variablesPage.actions.cancelRowEditing(editingRow);

variablesPage.getters.variablesRows().should('have.length', 3);
Expand Down
5 changes: 4 additions & 1 deletion cypress/pages/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export class VariablesPage extends BasePage {
},
setRowValue: (row: Chainable<JQuery<HTMLElement>>, field: 'key' | 'value', value: string) => {
row.within(() => {
cy.getByTestId(`variable-row-${field}-input`).type('{selectAll}{del}').type(value);
cy.getByTestId(`variable-row-${field}-input`)
.find('input, textarea')
.type('{selectAll}{del}')
.type(value);
});
},
cancelRowEditing: (row: Chainable<JQuery<HTMLElement>>) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/components/VariablesForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ const handleSubmit = () => {
class="key-input"
label=""
name="value"
data-test-id="variable-row-key-input"
data-test-id="variable-row-value-input"
:placeholder="i18n.baseText('variables.editing.value.placeholder')"
type="textarea"
autosize
:autosize="{ minRows: 1, maxRows: 6 }"
size="medium"
:maxlength="VALUE_MAX_LENGTH"
:validate-on-blur="validateOnBlur"
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/views/VariablesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ onMounted(() => {
.variables-key-column,
.variables-usage-column {
width: 300px;
min-width: 300px;
width: 25%;
min-width: 200px;
}
.variables-value-column {
Expand Down

0 comments on commit 005ef5d

Please sign in to comment.