mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Fix flaky e2e policies (#4190)
This commit is contained in:
parent
381d3b4206
commit
439d6f0623
@ -110,7 +110,9 @@ describe("Policies flow (seeded)", () => {
|
||||
cy.findByText(/backup/i).should("not.exist");
|
||||
});
|
||||
it("creates a failing policies webhook", () => {
|
||||
cy.findByRole("button", { name: /manage automations/i }).click();
|
||||
cy.getAttached(".button-wrap").within(() => {
|
||||
cy.findByRole("button", { name: /manage automations/i }).click();
|
||||
});
|
||||
cy.getAttached(".manage-automations-modal").within(() => {
|
||||
cy.getAttached(".fleet-checkbox__input").check({ force: true });
|
||||
});
|
||||
@ -118,7 +120,9 @@ describe("Policies flow (seeded)", () => {
|
||||
cy.findByRole("button", { name: /^Save$/ }).click();
|
||||
// Confirm failing policies webhook was added successfully
|
||||
cy.findByText(/updated policy automations/i).should("exist");
|
||||
cy.findByRole("button", { name: /manage automations/i }).click();
|
||||
cy.getAttached(".button-wrap").within(() => {
|
||||
cy.findByRole("button", { name: /manage automations/i }).click();
|
||||
});
|
||||
cy.getAttached(".manage-automations-modal").within(() => {
|
||||
cy.getAttached(".fleet-checkbox__input").should("be.checked");
|
||||
});
|
||||
|
@ -362,15 +362,18 @@ const ManagePolicyPage = ({
|
||||
</div>
|
||||
</div>
|
||||
<div className={`${baseClass} button-wrap`}>
|
||||
{canAddOrRemovePolicy && teamId === 0 && (
|
||||
<Button
|
||||
onClick={() => onManageAutomationsClick()}
|
||||
className={`${baseClass}__manage-automations button`}
|
||||
variant="inverse"
|
||||
>
|
||||
<span>Manage automations</span>
|
||||
</Button>
|
||||
)}
|
||||
{canAddOrRemovePolicy &&
|
||||
teamId === 0 &&
|
||||
!isLoadingFailingPoliciesWebhook &&
|
||||
!isLoadingGlobalPolicies && (
|
||||
<Button
|
||||
onClick={() => onManageAutomationsClick()}
|
||||
className={`${baseClass}__manage-automations button`}
|
||||
variant="inverse"
|
||||
>
|
||||
<span>Manage automations</span>
|
||||
</Button>
|
||||
)}
|
||||
{canAddOrRemovePolicy && (
|
||||
<div className={`${baseClass}__action-button-container`}>
|
||||
<Button
|
||||
@ -450,7 +453,7 @@ const ManagePolicyPage = ({
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
{showInheritedPoliciesButton && (
|
||||
{showInheritedPoliciesButton && globalPolicies && (
|
||||
<span>
|
||||
<Button
|
||||
variant="unstyled"
|
||||
|
Loading…
Reference in New Issue
Block a user