-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Trusty DB fields (#3305)
* Support for Trusty DB fields * Added granularity to the type of error & useDebounce func * Fix tests & add a DBConnecting state check * unsecret-ify the mock secret * Reduce already installed creationTimestamp for trusty tests * Remove odd cancel in debounce logic
- Loading branch information
1 parent
63e8206
commit 0c15247
Showing
37 changed files
with
1,188 additions
and
588 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
frontend/src/__tests__/cypress/cypress/pages/components/TrustyAICRState.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { DeleteModal } from '~/__tests__/cypress/cypress/pages/components/DeleteModal'; | ||
import { Modal } from '~/__tests__/cypress/cypress/pages/components/Modal'; | ||
|
||
/** Duped to avoid importing code from the app into tests (and breaking webpack) */ | ||
const TRUSTYAI_INSTALL_MODAL_TEST_ID = 'trusty-db-config'; | ||
|
||
export class TrustyAICRState { | ||
configureModal = new TrustyAICRModal(); | ||
|
||
deleteModal = new TrustyAIUninstallModal(); | ||
|
||
findError(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return cy.findByTestId('trustyai-service-error'); | ||
} | ||
|
||
findUninstallButton(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return cy.findByTestId('trustyai-uninstall-button'); | ||
} | ||
|
||
findInstallButton(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return cy.findByTestId('trustyai-configure-button'); | ||
} | ||
} | ||
|
||
class TrustyAICRModal extends Modal { | ||
constructor() { | ||
super('Configure TrustyAI service'); | ||
} | ||
|
||
findSubmitButton(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return cy.findByTestId('modal-submit-button'); | ||
} | ||
|
||
private findField(fieldName: string): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return cy.findByTestId(`${TRUSTYAI_INSTALL_MODAL_TEST_ID}-${fieldName}`); | ||
} | ||
|
||
findExistingRadio(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.findField('radio-existing'); | ||
} | ||
|
||
findNewRadio(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.findField('radio-new'); | ||
} | ||
|
||
findExistingNameField(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.findField('existing-secret'); | ||
} | ||
|
||
findNewKindField(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.findField('databaseKind'); | ||
} | ||
|
||
findNewUsernameField(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.findField('databaseUsername'); | ||
} | ||
|
||
findNewPasswordField(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.findField('databasePassword'); | ||
} | ||
|
||
findNewServiceField(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.findField('databaseService'); | ||
} | ||
|
||
findNewPortField(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.findField('databasePort'); | ||
} | ||
|
||
findNewDbNameField(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.findField('databaseName'); | ||
} | ||
|
||
findNewGenerationField(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.findField('databaseGeneration'); | ||
} | ||
} | ||
|
||
class TrustyAIUninstallModal extends DeleteModal { | ||
constructor() { | ||
super('Warning alert: Uninstall TrustyAI'); | ||
} | ||
|
||
findSubmitButton() { | ||
return this.findFooter().findByRole('button', { name: 'Uninstall' }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.