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