Skip to content

Commit

Permalink
console: fix remove column test (#5622)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandra Sikora authored Aug 20, 2020
1 parent 72ecaed commit b93da39
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
14 changes: 11 additions & 3 deletions console/cypress/integration/data/modify/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,20 @@ export const passModifyPkey = () => {
cy.get(getElementFromAlias('modify-table-edit-pks')).click();
cy.get(getElementFromAlias('primary-key-select-1')).select('1');
cy.get(getElementFromAlias('modify-table-pks-save')).click();
cy.get(getElementFromAlias('pk-config-text')).within(() => {
cy.get('b').contains(getColName(0));
cy.get('b').contains('id');
});
cy.wait(5000);
// TODO
// test disappearance expect
// (cy.get(getElementFromAlias('modify-table-column-1-remove'))).not.to.exist;

cy.get(getElementFromAlias('remove-pk-column-1')).click();
cy.get(getElementFromAlias('modify-table-pks-save')).click();
cy.get(getElementFromAlias('pk-config-text')).within(() => {
cy.get('b').contains('id');
});
cy.get(getElementFromAlias('pk-config-text')).within(() => {
cy.get('b').should('not.contain', getColName(0));
});
cy.get(getElementFromAlias('modify-table-close-pks')).click();
cy.wait(3000);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const PrimaryKeyEditor = ({
);

// label next to the button when the editor is expanded
const pkEditorExpandedLabel = () => <div>{pkConfigText}</div>;
const pkEditorExpandedLabel = () => (
<div data-test="pk-config-text">{pkConfigText}</div>
);

// expanded editor content
const pkEditorExpanded = () => (
Expand Down Expand Up @@ -95,7 +97,9 @@ const PrimaryKeyEditor = ({
);
};

useEffect(setPkEditState, [columns]);
useEffect(() => {
setPkEditState();
}, [columns.length]);

// remove
const onRemove = () => {
Expand Down

0 comments on commit b93da39

Please sign in to comment.