Skip to content

Commit eb1e2a6

Browse files
Add a button to use replicates for comparisons when available (#895)
* WIP * Change ToggleButton to Switch * Address change request
1 parent 54070c6 commit eb1e2a6

22 files changed

+464
-174
lines changed

src/__tests__/CompareResults/RevisionRow.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ describe('<RevisionRow>', () => {
7070
result={rowData}
7171
view={compareView}
7272
gridTemplateColumns='none'
73+
replicates={false}
7374
/>,
7475
);
7576
const shortNameNode = await screen.findByText(shortName);
@@ -97,6 +98,7 @@ describe('Expanded row', () => {
9798
result={rowData[0] as CompareResultsItem}
9899
view={compareView}
99100
gridTemplateColumns='none'
101+
replicates={false}
100102
/>,
101103
);
102104

@@ -126,6 +128,7 @@ describe('Expanded row', () => {
126128
result={testCompareData[0]}
127129
view={compareView}
128130
gridTemplateColumns='none'
131+
replicates={false}
129132
/>,
130133
);
131134

src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ describe('SubtestsRevisionRow Component', () => {
2929
<SubtestsRevisionRow
3030
result={subtestsResult[0]}
3131
gridTemplateColumns={mockGridTemplateColumns}
32+
replicates={false}
3233
/>,
3334
);
3435

@@ -48,6 +49,7 @@ describe('SubtestsRevisionRow Component', () => {
4849
<SubtestsRevisionRow
4950
result={subtestsResult[2]}
5051
gridTemplateColumns={mockGridTemplateColumns}
52+
replicates={false}
5153
/>,
5254
);
5355

@@ -63,6 +65,7 @@ describe('SubtestsRevisionRow Component', () => {
6365
<SubtestsRevisionRow
6466
result={subtestsResult[3]}
6567
gridTemplateColumns={mockGridTemplateColumns}
68+
replicates={false}
6669
/>,
6770
);
6871

@@ -78,6 +81,7 @@ describe('SubtestsRevisionRow Component', () => {
7881
<SubtestsRevisionRow
7982
result={subtestsResult[4]}
8083
gridTemplateColumns={mockGridTemplateColumns}
84+
replicates={false}
8185
/>,
8286
);
8387

@@ -96,6 +100,7 @@ describe('SubtestsRevisionRow Component', () => {
96100
<SubtestsRevisionRow
97101
result={subtestsResult[0]}
98102
gridTemplateColumns={mockGridTemplateColumns}
103+
replicates={false}
99104
/>,
100105
);
101106

src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap

Lines changed: 65 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -716,36 +716,79 @@ exports[`Results Table Should match snapshot 1`] = `
716716
>
717717
<header>
718718
<div
719-
class="MuiGrid-root MuiGrid-container MuiGrid-direction-xs-row css-suqpw6-MuiGrid-root"
719+
class="MuiGrid-root MuiGrid-container MuiGrid-direction-xs-row css-cv4vpp-MuiGrid-root"
720720
>
721-
<h2
722-
class="MuiGrid-root MuiGrid-direction-xs-row f1sq1266 css-k4qgqg-MuiGrid-root"
723-
>
724-
Results
725-
</h2>
726-
<button
727-
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-disableElevation MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-disableElevation css-7tm9pg-MuiButtonBase-root-MuiButton-root"
728-
tabindex="0"
729-
type="button"
721+
<div
722+
class="MuiGrid-root MuiGrid-container MuiGrid-direction-xs-row css-ztkbb6-MuiGrid-root"
730723
>
731-
<span
732-
class="MuiButton-icon MuiButton-startIcon MuiButton-iconSizeMedium css-1v1j2p3-MuiButton-startIcon"
724+
<h2
725+
class="MuiGrid-root MuiGrid-direction-xs-row f1sq1266 css-k4qgqg-MuiGrid-root"
733726
>
734-
<img
735-
role="presentation"
736-
src="pencil.svg"
737-
/>
738-
</span>
739-
Edit title
740-
</button>
727+
Results
728+
</h2>
729+
<button
730+
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-disableElevation MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-disableElevation css-7tm9pg-MuiButtonBase-root-MuiButton-root"
731+
tabindex="0"
732+
type="button"
733+
>
734+
<span
735+
class="MuiButton-icon MuiButton-startIcon MuiButton-iconSizeMedium css-1v1j2p3-MuiButton-startIcon"
736+
>
737+
<img
738+
role="presentation"
739+
src="pencil.svg"
740+
/>
741+
</span>
742+
Edit title
743+
</button>
744+
<h2
745+
class="MuiGrid-root MuiGrid-direction-xs-row f11kzsvi css-k4qgqg-MuiGrid-root"
746+
>
747+
Compare with a base
748+
</h2>
749+
</div>
741750
<h2
742-
class="MuiGrid-root MuiGrid-direction-xs-row f11kzsvi css-k4qgqg-MuiGrid-root"
751+
class="MuiGrid-root MuiGrid-direction-xs-row ff3k5ad css-k4qgqg-MuiGrid-root"
743752
>
744-
Compare with a base
753+
<div
754+
class="f1qbk2gm MuiBox-root css-0"
755+
>
756+
<div
757+
class="MuiFormGroup-root css-1mac7pt-MuiFormGroup-root"
758+
>
759+
<label
760+
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementStart css-1lhdpr4-MuiFormControlLabel-root"
761+
>
762+
<span
763+
class="MuiSwitch-root MuiSwitch-sizeMedium toggle-switch css-rehya9-MuiSwitch-root"
764+
>
765+
<span
766+
class="MuiButtonBase-root MuiSwitch-switchBase MuiSwitch-colorPrimary PrivateSwitchBase-root MuiSwitch-switchBase MuiSwitch-colorPrimary css-1jkkk7l-MuiButtonBase-root-MuiSwitchBase-root-MuiSwitch-switchBase"
767+
>
768+
<input
769+
class="PrivateSwitchBase-input MuiSwitch-input css-12xagqm-MuiSwitchBase-root"
770+
type="checkbox"
771+
/>
772+
<span
773+
class="MuiSwitch-thumb css-17jyosd-MuiSwitch-thumb"
774+
/>
775+
</span>
776+
<span
777+
class="MuiSwitch-track css-tj8d99-MuiSwitch-track"
778+
/>
779+
</span>
780+
<span
781+
class="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label css-1vajmro-MuiTypography-root"
782+
>
783+
Replicates
784+
</span>
785+
</label>
786+
</div>
787+
</div>
745788
</h2>
746789
</div>
747790
<div
748-
class="MuiGrid-root MuiGrid-container MuiGrid-direction-xs-row css-suqpw6-MuiGrid-root"
791+
class="MuiGrid-root MuiGrid-container MuiGrid-direction-xs-row css-cv4vpp-MuiGrid-root"
749792
>
750793
<div
751794
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard f1q43ty0 css-st68mf-MuiPaper-root-MuiAlert-root"

0 commit comments

Comments
 (0)