Skip to content

Commit

Permalink
Revert the flyout backdrop change, remove the related test
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaindik committed Sep 13, 2024
1 parent 4f91329 commit d1cadfa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,13 +631,9 @@ Given no prebuilt rules are installed in Kibana
And there are X prebuilt rules of all types available to install
When user opens the Add Rules page
Then all X rules available for installation should be displayed in the table
When user opens the rule preview for the 1st rule
Then the preview should open
And all properties of the 1st rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
When user selects the 2nd rule in the table
Then the preview should be updated
And all properties of the 2nd rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
And user should be able to repeat this for all X rules
When user opens a rule preview for any rule
Then the preview should appear
And all properties of a rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
```

#### **Scenario: Tabs and sections without content should be hidden in preview before installing**
Expand Down Expand Up @@ -783,15 +779,11 @@ And for all of the installed rules there are new versions available
And user is on the Rule Management page
When user opens the Rule Updates table
Then all X rules available for upgrade should be displayed in the table
When user opens the rule preview for the 1st rule
Then the preview should open
When user opens a rule preview for any rule
Then the preview should appear
And the "Updates" tab should be active
When user selects the "Overview" tab
Then all properties of the new version of the 1st rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
When user selects the 2nd rule in the table
Then the preview should be updated
And all properties of the new version of the 2nd rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
And user should be able to repeat this for all X rules
Then all properties of the new version of a rule should be displayed in the correct tab and section of the preview (see examples of rule properties above)
```

#### **Scenario: Tabs and sections without content should be hidden in preview before upgrading**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export const RuleDetailsFlyout = ({
paddingSize="l"
data-test-subj={dataTestSubj}
aria-labelledby={prebuiltRulesFlyoutTitleId}
ownFocus={false}
ownFocus
>
<EuiFlyoutHeader>
<EuiTitle size="m">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1104,8 +1104,10 @@ describe(
.contains('"name": "Outdated rule 1"')
.should('be.visible');

/* Select another rule without closing the preview for the current rule */
closeRulePreview();

openRuleUpdatePreview(OUTDATED_RULE_2['security-rule'].name);
selectPreviewTab(PREVIEW_TABS.JSON_VIEW);

/* Make sure the JSON diff is displayed for the newly selected rule */
cy.get(UPDATE_PREBUILT_RULE_PREVIEW)
Expand Down Expand Up @@ -1177,36 +1179,6 @@ describe(
cy.get(PER_FIELD_DIFF_WRAPPER).last().contains('Updated rule 1').should('be.visible');
});

it('User can switch between rules upgrades without closing flyout', () => {
clickRuleUpdatesTab();

openRuleUpdatePreview(OUTDATED_RULE_1['security-rule'].name);
assertSelectedPreviewTab(PREVIEW_TABS.UPDATES); // Should be open by default

/* Version should be the first field in the order */
cy.get(PER_FIELD_DIFF_WRAPPER).first().contains('Version').should('be.visible');
cy.get(PER_FIELD_DIFF_WRAPPER).first().contains('1').should('be.visible');
cy.get(PER_FIELD_DIFF_WRAPPER).first().contains('2').should('be.visible');

cy.get(PER_FIELD_DIFF_WRAPPER).last().contains('Name').should('be.visible');
cy.get(PER_FIELD_DIFF_WRAPPER).last().contains('Outdated rule 1').should('be.visible');
cy.get(PER_FIELD_DIFF_WRAPPER).last().contains('Updated rule 1').should('be.visible');

/* Select another rule without closing the preview for the current rule */
openRuleUpdatePreview(OUTDATED_RULE_2['security-rule'].name);

/* Make sure the per-field diff is displayed for the newly selected rule */
cy.get(PER_FIELD_DIFF_WRAPPER).last().contains('Name').should('be.visible');
cy.get(UPDATE_PREBUILT_RULE_PREVIEW).contains('Outdated rule 2').should('be.visible');
cy.get(UPDATE_PREBUILT_RULE_PREVIEW).contains('Updated rule 2').should('be.visible');
cy.get(UPDATE_PREBUILT_RULE_PREVIEW).contains('Outdated rule 1').should('not.exist');
cy.get(UPDATE_PREBUILT_RULE_PREVIEW).contains('Updated rule 1').should('not.exist');

cy.get(PER_FIELD_DIFF_WRAPPER).first().contains('Version').should('be.visible');
cy.get(PER_FIELD_DIFF_WRAPPER).first().contains('1').should('be.visible');
cy.get(PER_FIELD_DIFF_WRAPPER).first().contains('2').should('be.visible');
});

it('User can see changes when updated rule is a different rule type', () => {
const OUTDATED_RULE_WITH_QUERY_TYPE = createRuleAssetSavedObject({
name: 'Query rule',
Expand Down

0 comments on commit d1cadfa

Please sign in to comment.