Skip to content

Commit b9ac5b4

Browse files
authored
Merge pull request #1639 from ral-facilities/add-information-dialog-for-rules-#1494
Add information dialog for rules #1494
2 parents 72cfd96 + 524252d commit b9ac5b4

File tree

6 files changed

+534
-14
lines changed

6 files changed

+534
-14
lines changed

cypress/e2e/with_mock_data/rules.cy.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,17 @@ describe('Rules page', () => {
7878
cy.findByRole('button', { name: 'Clear Filters' }).should('be.disabled');
7979
cy.findByText('Moving Rules Filter Applied').should('not.exist');
8080
});
81+
82+
83+
it('opens information dialog from icon button', () => {
84+
cy.findByLabelText('Open information dialog').click();
85+
cy.findByText('Rules Information').should('exist');
86+
cy.get('button:contains("Example:")').should('have.length', 3)
87+
88+
cy.findByText('Example: Storage → Operational → \'In Use\'').click();
89+
cy.findByText('Items can be moved from the system type \'Storage\' to \'Operational\'. This rule sets the items usage status to \'In Use\'.').should('exist');
90+
91+
cy.findByRole('button', { name: 'Close' }).click();
92+
cy.findByText('Rules Information').should('not.exist');
93+
});
8194
});

src/settings/rules/__snapshots__/rules.component.test.tsx.snap

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,24 @@ exports[`Rules > renders table correctly 1`] = `
7272
>
7373
Show Deletion Rules
7474
</button>
75+
<button
76+
aria-label="Open information dialog"
77+
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium css-53g0n7-MuiButtonBase-root-MuiIconButton-root"
78+
tabindex="0"
79+
type="button"
80+
>
81+
<svg
82+
aria-hidden="true"
83+
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-1umw9bq-MuiSvgIcon-root"
84+
data-testid="InfoOutlinedIcon"
85+
focusable="false"
86+
viewBox="0 0 24 24"
87+
>
88+
<path
89+
d="M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"
90+
/>
91+
</svg>
92+
</button>
7593
</div>
7694
<div
7795
class="MuiBox-root css-1p0wbhh"
@@ -108,7 +126,7 @@ exports[`Rules > renders table correctly 1`] = `
108126
aria-invalid="false"
109127
autocomplete="off"
110128
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall MuiInputBase-inputAdornedStart MuiInputBase-inputAdornedEnd css-12tjcea-MuiInputBase-input-MuiOutlinedInput-input"
111-
id=":r5:"
129+
id=":r7:"
112130
placeholder="Search"
113131
type="text"
114132
value=""
@@ -374,13 +392,13 @@ exports[`Rules > renders table correctly 1`] = `
374392
</span>
375393
</div>
376394
<div
377-
aria-describedby=":ri:-helper-text"
395+
aria-describedby=":rk:-helper-text"
378396
aria-expanded="false"
379397
aria-haspopup="listbox"
380398
aria-label="Filter by Source System Type"
381-
aria-labelledby=":ri:"
399+
aria-labelledby=":rk:"
382400
class="MuiSelect-select MuiSelect-standard MuiSelect-multiple MuiInputBase-input MuiInput-input MuiInputBase-inputAdornedStart MuiInputBase-inputAdornedEnd css-10y8whu-MuiSelect-select-MuiInputBase-input-MuiInput-input"
383-
id=":ri:"
401+
id=":rk:"
384402
role="combobox"
385403
tabindex="0"
386404
>
@@ -442,7 +460,7 @@ exports[`Rules > renders table correctly 1`] = `
442460
</div>
443461
<p
444462
class="MuiFormHelperText-root MuiFormHelperText-sizeMedium css-v98l45-MuiFormHelperText-root"
445-
id=":ri:-helper-text"
463+
id=":rk:-helper-text"
446464
>
447465
<label>
448466
Filter Mode: Includes any
@@ -607,13 +625,13 @@ exports[`Rules > renders table correctly 1`] = `
607625
</span>
608626
</div>
609627
<div
610-
aria-describedby=":ru:-helper-text"
628+
aria-describedby=":r10:-helper-text"
611629
aria-expanded="false"
612630
aria-haspopup="listbox"
613631
aria-label="Filter by Destination System Type"
614-
aria-labelledby=":ru:"
632+
aria-labelledby=":r10:"
615633
class="MuiSelect-select MuiSelect-standard MuiSelect-multiple MuiInputBase-input MuiInput-input MuiInputBase-inputAdornedStart MuiInputBase-inputAdornedEnd css-10y8whu-MuiSelect-select-MuiInputBase-input-MuiInput-input"
616-
id=":ru:"
634+
id=":r10:"
617635
role="combobox"
618636
tabindex="0"
619637
>
@@ -675,7 +693,7 @@ exports[`Rules > renders table correctly 1`] = `
675693
</div>
676694
<p
677695
class="MuiFormHelperText-root MuiFormHelperText-sizeMedium css-v98l45-MuiFormHelperText-root"
678-
id=":ru:-helper-text"
696+
id=":r10:-helper-text"
679697
>
680698
<label>
681699
Filter Mode: Includes any
@@ -840,13 +858,13 @@ exports[`Rules > renders table correctly 1`] = `
840858
</span>
841859
</div>
842860
<div
843-
aria-describedby=":r1a:-helper-text"
861+
aria-describedby=":r1c:-helper-text"
844862
aria-expanded="false"
845863
aria-haspopup="listbox"
846864
aria-label="Filter by Destination Usage Status"
847-
aria-labelledby=":r1a:"
865+
aria-labelledby=":r1c:"
848866
class="MuiSelect-select MuiSelect-standard MuiSelect-multiple MuiInputBase-input MuiInput-input MuiInputBase-inputAdornedStart MuiInputBase-inputAdornedEnd css-10y8whu-MuiSelect-select-MuiInputBase-input-MuiInput-input"
849-
id=":r1a:"
867+
id=":r1c:"
850868
role="combobox"
851869
tabindex="0"
852870
>
@@ -908,7 +926,7 @@ exports[`Rules > renders table correctly 1`] = `
908926
</div>
909927
<p
910928
class="MuiFormHelperText-root MuiFormHelperText-sizeMedium css-v98l45-MuiFormHelperText-root"
911-
id=":r1a:-helper-text"
929+
id=":r1c:-helper-text"
912930
>
913931
<label>
914932
Filter Mode: Includes any

0 commit comments

Comments
 (0)