Skip to content

Commit

Permalink
Update jest tests
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Li <[email protected]>
  • Loading branch information
joshuali925 committed Mar 30, 2022
1 parent 450e044 commit fafcc02
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 128 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ exports[`<GanttChart /> spec renders empty prompt when no data is returned 1`] =
<div
class="euiEmptyPrompt"
>
<h2
class="euiTitle euiTitle--medium"
>
No data
</h2>
<span
class="euiTextColor euiTextColor--subdued"
>
<h2
class="euiTitle euiTitle--medium"
>
No data
</h2>
<div
class="euiSpacer euiSpacer--m"
/>
Expand All @@ -32,14 +32,14 @@ exports[`<GanttChart /> spec renders empty prompt when no field is selected 1`]
<div
class="euiEmptyPrompt"
>
<h2
class="euiTitle euiTitle--medium"
>
No data
</h2>
<span
class="euiTextColor euiTextColor--subdued"
>
<h2
class="euiTitle euiTitle--medium"
>
No data
</h2>
<div
class="euiSpacer euiSpacer--m"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`<GanttChartEditor /> spec renders the component 1`] = `
<div
class="euiPanel euiPanel--paddingSmall"
class="euiPanel euiPanel--paddingSmall euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
>
<h3
class="euiTitle euiTitle--xsmall"
Expand Down Expand Up @@ -30,62 +30,63 @@ exports[`<GanttChartEditor /> spec renders the component 1`] = `
class="euiFormRow__fieldWrapper"
>
<div
class="euiPopover euiPopover--anchorDownCenter euiPopover--displayBlock euiSuperSelect"
class="euiPopover euiPopover--anchorDownLeft euiPopover--displayBlock euiInputPopover euiSuperSelect"
>
<div
class="euiPopover__anchor"
>
<input
id="random_html_id"
type="hidden"
value="spanID"
/>
<div
class="euiFormControlLayout"
>
<div>
<input
id="random_html_id"
type="hidden"
value="spanID"
/>
<div
class="euiFormControlLayout__childrenWrapper"
class="euiFormControlLayout"
>
<span
class="euiScreenReaderOnly"
id="random_html_id"
>
Select an option:
, is selected
</span>
<button
aria-describedby="random_html_id-help"
aria-haspopup="true"
aria-labelledby="random_html_id random_html_id"
class="euiSuperSelectControl"
data-test-subj="gantt-chart-editor-label-field"
type="button"
/>
<div
class="euiFormControlLayoutIcons euiFormControlLayoutIcons--right"
class="euiFormControlLayout__childrenWrapper"
>
<span
class="euiFormControlLayoutCustomIcon"
class="euiScreenReaderOnly"
id="random_html_id"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
/>
Select an option: , is selected
</span>
<button
aria-describedby="random_html_id-help-0"
aria-haspopup="true"
aria-labelledby="random_html_id random_html_id"
class="euiSuperSelectControl"
data-test-subj="gantt-chart-editor-label-field"
type="button"
/>
<div
class="euiFormControlLayoutIcons euiFormControlLayoutIcons--right"
>
<span
class="euiFormControlLayoutCustomIcon"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
/>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="euiFormHelpText euiFormRow__text"
id="random_html_id-help"
id="random_html_id-help-0"
>
Gantt chart allows you to compare schedules of the selected field.
</div>
Expand All @@ -109,62 +110,63 @@ exports[`<GanttChartEditor /> spec renders the component 1`] = `
class="euiFormRow__fieldWrapper"
>
<div
class="euiPopover euiPopover--anchorDownCenter euiPopover--displayBlock euiSuperSelect"
class="euiPopover euiPopover--anchorDownLeft euiPopover--displayBlock euiInputPopover euiSuperSelect"
>
<div
class="euiPopover__anchor"
>
<input
id="random_html_id"
type="hidden"
value="startTime"
/>
<div
class="euiFormControlLayout"
>
<div>
<input
id="random_html_id"
type="hidden"
value="startTime"
/>
<div
class="euiFormControlLayout__childrenWrapper"
class="euiFormControlLayout"
>
<span
class="euiScreenReaderOnly"
id="random_html_id"
>
Select an option:
, is selected
</span>
<button
aria-describedby="random_html_id-help"
aria-haspopup="true"
aria-labelledby="random_html_id random_html_id"
class="euiSuperSelectControl"
data-test-subj="gantt-chart-editor-start-time-field"
type="button"
/>
<div
class="euiFormControlLayoutIcons euiFormControlLayoutIcons--right"
class="euiFormControlLayout__childrenWrapper"
>
<span
class="euiFormControlLayoutCustomIcon"
class="euiScreenReaderOnly"
id="random_html_id"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
/>
Select an option: , is selected
</span>
<button
aria-describedby="random_html_id-help-0"
aria-haspopup="true"
aria-labelledby="random_html_id random_html_id"
class="euiSuperSelectControl"
data-test-subj="gantt-chart-editor-start-time-field"
type="button"
/>
<div
class="euiFormControlLayoutIcons euiFormControlLayoutIcons--right"
>
<span
class="euiFormControlLayoutCustomIcon"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
/>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="euiFormHelpText euiFormRow__text"
id="random_html_id-help"
id="random_html_id-help-0"
>
Select a timestamp field to represent the beginning of a schedule.
</div>
Expand All @@ -188,62 +190,63 @@ exports[`<GanttChartEditor /> spec renders the component 1`] = `
class="euiFormRow__fieldWrapper"
>
<div
class="euiPopover euiPopover--anchorDownCenter euiPopover--displayBlock euiSuperSelect"
class="euiPopover euiPopover--anchorDownLeft euiPopover--displayBlock euiInputPopover euiSuperSelect"
>
<div
class="euiPopover__anchor"
>
<input
id="random_html_id"
type="hidden"
value="duration"
/>
<div
class="euiFormControlLayout"
>
<div>
<input
id="random_html_id"
type="hidden"
value="duration"
/>
<div
class="euiFormControlLayout__childrenWrapper"
class="euiFormControlLayout"
>
<span
class="euiScreenReaderOnly"
id="random_html_id"
>
Select an option:
, is selected
</span>
<button
aria-describedby="random_html_id-help"
aria-haspopup="true"
aria-labelledby="random_html_id random_html_id"
class="euiSuperSelectControl"
data-test-subj="gantt-chart-editor-duration-field"
type="button"
/>
<div
class="euiFormControlLayoutIcons euiFormControlLayoutIcons--right"
class="euiFormControlLayout__childrenWrapper"
>
<span
class="euiFormControlLayoutCustomIcon"
class="euiScreenReaderOnly"
id="random_html_id"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
/>
Select an option: , is selected
</span>
<button
aria-describedby="random_html_id-help-0"
aria-haspopup="true"
aria-labelledby="random_html_id random_html_id"
class="euiSuperSelectControl"
data-test-subj="gantt-chart-editor-duration-field"
type="button"
/>
<div
class="euiFormControlLayoutIcons euiFormControlLayoutIcons--right"
>
<span
class="euiFormControlLayoutCustomIcon"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
/>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="euiFormHelpText euiFormRow__text"
id="random_html_id-help"
id="random_html_id-help-0"
>
Value of duration field must be a time interval that can be added to the start timestamp field.
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`<OptionsEditor /> spec renders the component 1`] = `
<div
class="euiPanel euiPanel--paddingSmall"
class="euiPanel euiPanel--paddingSmall euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
>
<h3
class="euiTitle euiTitle--xsmall"
Expand Down Expand Up @@ -233,7 +233,7 @@ exports[`<OptionsEditor /> spec renders the component 1`] = `

exports[`<OptionsEditor /> spec renders the component with different options 1`] = `
<div
class="euiPanel euiPanel--paddingSmall"
class="euiPanel euiPanel--paddingSmall euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
>
<h3
class="euiTitle euiTitle--xsmall"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('<OptionsEditor /> spec', () => {
it('sets colors', () => {
const setValue = jest.fn();
const utils = render(<OptionsEditor {...mockEditorProps(setValue)} />);
const colorPicker = utils.getByTestId('colorPickerAnchor');
const colorPicker = utils.getByTestId('euiColorPickerAnchor');
fireEvent.change(colorPicker, { target: { value: '#EEEEEE' } });
expect(setValue).toBeCalledWith('colors', '#EEEEEE');
});
Expand Down

0 comments on commit fafcc02

Please sign in to comment.