mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-01 11:19:05 +00:00
fix(cypress) Fix flaky modules.js cypress test (#14606)
This commit is contained in:
parent
bffb2ffdc5
commit
efb0a6ff31
@ -207,6 +207,7 @@ export function useTemplateOperations(
|
||||
showToast(
|
||||
'You’ve edited your home page',
|
||||
`To reset your home page click "Reset to Organization Default"`,
|
||||
'edited-home-page-toast',
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@ -14,10 +14,10 @@ const notificationStyles = {
|
||||
};
|
||||
|
||||
export default function useShowToast() {
|
||||
function showToast(title: string, description?: string) {
|
||||
function showToast(title: string, description?: string, dataTestId?: string) {
|
||||
notification.open({
|
||||
message: (
|
||||
<Text color="blue" colorLevel={1000} weight="semiBold" lineHeight="sm">
|
||||
<Text color="blue" colorLevel={1000} weight="semiBold" lineHeight="sm" data-testid={dataTestId}>
|
||||
{title}
|
||||
</Text>
|
||||
),
|
||||
|
||||
@ -93,6 +93,7 @@ describe("home page modules", () => {
|
||||
|
||||
it("remove default module", () => {
|
||||
addYourAssetsModule();
|
||||
cy.ensureElementWithTestIdPresent("edited-home-page-toast");
|
||||
removeFirstModuleWithTestId("your-assets-module");
|
||||
cy.getWithTestId("your-assets-module").should("have.length.lessThan", 2);
|
||||
cy.getWithTestId("your-assets-module").should("have.length", 1);
|
||||
@ -144,6 +145,7 @@ describe("home page modules", () => {
|
||||
it("add home default module", () => {
|
||||
const name = "Global Collection Module";
|
||||
addYourAssetsModule();
|
||||
cy.ensureElementWithTestIdPresent("edited-home-page-toast");
|
||||
startEditingDefaultTemplate();
|
||||
createAssetCollectionModule(name);
|
||||
finishEditingDefaultTemplate();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user