Skip to content

Commit

Permalink
Fixing snaps
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed Jun 6, 2022
1 parent 85669ec commit 4f7a811
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ exports[`EuiInMemoryTable behavior pagination 1`] = `
class="euiPopover__anchor"
>
<button
class="euiButtonEmpty euiButtonEmpty--text euiButtonEmpty--xSmall"
class="euiButtonEmpty euiButtonEmpty--xSmall css-15qfgye-empty-text"
data-test-subj="tablePaginationPopoverButton"
type="button"
>
Expand Down Expand Up @@ -160,7 +160,7 @@ exports[`EuiInMemoryTable behavior pagination 1`] = `
<a
aria-controls="__table_generated-id"
aria-label="Previous page"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall euiPaginationArrowButton"
class="euiButtonIcon euiButtonIcon--empty euiButtonIcon--xSmall euiPaginationArrowButton css-19g5rpb-empty-text-EuiButtonIcon"
data-test-subj="pagination-button-previous"
href="#__table_generated-id"
rel="noreferrer"
Expand All @@ -183,7 +183,7 @@ exports[`EuiInMemoryTable behavior pagination 1`] = `
<a
aria-controls="__table_generated-id"
aria-label="Page 1 of 2"
class="euiButtonEmpty euiButtonEmpty--text euiButtonEmpty--small euiPaginationButton"
class="euiButtonEmpty euiButtonEmpty--small euiPaginationButton css-15qfgye-empty-text"
data-test-subj="pagination-button-0"
href="#__table_generated-id"
rel="noreferrer"
Expand All @@ -206,7 +206,7 @@ exports[`EuiInMemoryTable behavior pagination 1`] = `
aria-controls="__table_generated-id"
aria-current="true"
aria-label="Page 2 of 2"
class="euiButtonEmpty euiButtonEmpty--text euiButtonEmpty--small euiButtonEmpty-isDisabled euiPaginationButton euiPaginationButton-isActive"
class="euiButtonEmpty euiButtonEmpty--small euiPaginationButton euiPaginationButton-isActive css-13li5q5-empty-disabled"
data-test-subj="pagination-button-1"
disabled=""
type="button"
Expand All @@ -225,7 +225,7 @@ exports[`EuiInMemoryTable behavior pagination 1`] = `
</ul>
<button
aria-label="Next page"
class="euiButtonIcon euiButtonIcon-isDisabled euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall euiPaginationArrowButton"
class="euiButtonIcon euiButtonIcon--empty euiButtonIcon--xSmall euiPaginationArrowButton css-1w4v2zr-empty-disabled-EuiButtonIcon"
data-test-subj="pagination-button-next"
disabled=""
type="button"
Expand Down
10 changes: 5 additions & 5 deletions src/components/basic_table/in_memory_table.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ describe('EuiInMemoryTable', () => {
const component = mount(<EuiInMemoryTable {...props} />);

component
.find('EuiButtonEmpty[data-test-subj="pagination-button-1"]')
.find('a[data-test-subj="pagination-button-1"]')
.simulate('click');

// forces EuiInMemoryTable's getDerivedStateFromProps to re-execute
Expand Down Expand Up @@ -1011,7 +1011,7 @@ describe('EuiInMemoryTable', () => {
const component = mount(<EuiInMemoryTable {...props} />);

component
.find('EuiButtonEmpty[data-test-subj="pagination-button-1"]')
.find('a[data-test-subj="pagination-button-1"]')
.simulate('click');
});

Expand Down Expand Up @@ -1044,7 +1044,7 @@ describe('EuiInMemoryTable', () => {

// Pagination change
component
.find('EuiButtonEmpty[data-test-subj="pagination-button-1"]')
.find('a[data-test-subj="pagination-button-1"]')
.simulate('click');
expect(props.onTableChange).toHaveBeenCalledTimes(1);
expect(props.onTableChange).toHaveBeenLastCalledWith({
Expand Down Expand Up @@ -1075,7 +1075,7 @@ describe('EuiInMemoryTable', () => {

// Sorted pagination change
component
.find('EuiButtonEmpty[data-test-subj="pagination-button-1"]')
.find('a[data-test-subj="pagination-button-1"]')
.simulate('click');
expect(props.onTableChange).toHaveBeenCalledTimes(3);
expect(props.onTableChange).toHaveBeenLastCalledWith({
Expand Down Expand Up @@ -1132,7 +1132,7 @@ describe('EuiInMemoryTable', () => {

// click the first pagination button
component
.find('EuiButtonEmpty[data-test-subj="pagination-button-0"]')
.find('a[data-test-subj="pagination-button-0"]')
.simulate('click');
expect(onTableChange).toHaveBeenCalledTimes(1);
expect(onTableChange).toHaveBeenCalledWith({
Expand Down
112 changes: 101 additions & 11 deletions src/components/code/__snapshots__/code_block.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,115 @@ exports[`EuiCodeBlock fullscreen displays content in fullscreen mode 1`] = `
>
<button
aria-label="Collapse"
className="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall euiCodeBlock__fullScreenButton"
css="unknown styles"
onClick={[Function]}
type="button"
>
<EuiIcon
aria-hidden="true"
className="euiButtonIcon__icon"
color="inherit"
size="m"
type="fullScreenExit"
<Insertion
cache={
Object {
"insert": [Function],
"inserted": Object {
"19g5rpb-empty-text-EuiButtonIcon": true,
},
"key": "css",
"nonce": undefined,
"registered": Object {},
"sheet": StyleSheet {
"_alreadyInsertedOrderInsensitiveRule": true,
"_insertTag": [Function],
"before": null,
"container": <head>
<style
data-emotion="css"
data-s=""
>
.css-19g5rpb-empty-text-EuiButtonIcon{color:#343741;}
</style>
<style
data-emotion="css"
data-s=""
>
.css-19g5rpb-empty-text-EuiButtonIcon:hover,.css-19g5rpb-empty-text-EuiButtonIcon:focus,.css-19g5rpb-empty-text-EuiButtonIcon:active{background-color:rgba(211,218,230,0.2);}
</style>
<style
type="text/css"
>
[data-focus-on-hidden] {
pointer-events: none !important;
}
</style>
</head>,
"ctr": 2,
"insertionPoint": undefined,
"isSpeedy": false,
"key": "css",
"nonce": undefined,
"prepend": undefined,
"tags": Array [
<style
data-emotion="css"
data-s=""
>
.css-19g5rpb-empty-text-EuiButtonIcon{color:#343741;}
</style>,
<style
data-emotion="css"
data-s=""
>
.css-19g5rpb-empty-text-EuiButtonIcon:hover,.css-19g5rpb-empty-text-EuiButtonIcon:focus,.css-19g5rpb-empty-text-EuiButtonIcon:active{background-color:rgba(211,218,230,0.2);}
</style>,
],
},
}
}
isStringTag={true}
serialized={
Object {
"map": undefined,
"name": "19g5rpb-empty-text-EuiButtonIcon",
"next": undefined,
"styles": "
color: #343741;
&:hover,
&:focus,
&:active {
background-color: rgba(211,218,230,0.2);
}
;;label:empty;;;label:text;;;;label:EuiButtonIcon;;",
"toString": [Function],
}
}
/>
<button
aria-label="Collapse"
className="euiButtonIcon euiButtonIcon--empty euiButtonIcon--xSmall euiCodeBlock__fullScreenButton css-19g5rpb-empty-text-EuiButtonIcon"
onClick={[Function]}
type="button"
>
<span
<EuiIcon
aria-hidden="true"
className="euiButtonIcon__icon"
color="inherit"
data-euiicon-type="fullScreenExit"
size="m"
/>
</EuiIcon>
type="fullScreenExit"
>
<span
aria-hidden="true"
className="euiButtonIcon__icon"
color="inherit"
data-euiicon-type="fullScreenExit"
size="m"
/>
</EuiIcon>
</button>
</button>
</EuiButtonIcon>
</EuiI18n>
Expand Down
4 changes: 2 additions & 2 deletions src/components/code/code_block.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('EuiCodeBlock', () => {
</EuiCodeBlock>
);

component.find('EuiButtonIcon[iconType="fullScreen"]').simulate('click');
component.find('button[aria-label="Expand"]').simulate('click');
component.update();

expect(component.find('.euiCodeBlock-isFullScreen')).toMatchSnapshot();
Expand All @@ -175,7 +175,7 @@ describe('EuiCodeBlock', () => {
</EuiCodeBlock>
);

component.find('EuiButtonIcon[iconType="fullScreen"]').simulate('click');
component.find('button[aria-label="Expand"]').simulate('click');
component.update();
component
.find('.euiCodeBlock-isFullScreen')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`EuiMarkdownEditor custom plugins are excluded and popover is rendered 1
>
<button
aria-label="Bold"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
class="euiButtonIcon euiButtonIcon--empty euiButtonIcon--xSmall css-19g5rpb-empty-text-EuiButtonIcon"
data-test-subj="euiMarkdownEditorToolbarButton"
type="button"
>
Expand All @@ -34,7 +34,7 @@ exports[`EuiMarkdownEditor custom plugins are excluded and popover is rendered 1
>
<button
aria-label="Italic"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
class="euiButtonIcon euiButtonIcon--empty euiButtonIcon--xSmall css-19g5rpb-empty-text-EuiButtonIcon"
data-test-subj="euiMarkdownEditorToolbarButton"
type="button"
>
Expand All @@ -54,7 +54,7 @@ exports[`EuiMarkdownEditor custom plugins are excluded and popover is rendered 1
>
<button
aria-label="Unordered list"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
class="euiButtonIcon euiButtonIcon--empty euiButtonIcon--xSmall css-19g5rpb-empty-text-EuiButtonIcon"
data-test-subj="euiMarkdownEditorToolbarButton"
type="button"
>
Expand All @@ -71,7 +71,7 @@ exports[`EuiMarkdownEditor custom plugins are excluded and popover is rendered 1
>
<button
aria-label="Ordered list"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
class="euiButtonIcon euiButtonIcon--empty euiButtonIcon--xSmall css-19g5rpb-empty-text-EuiButtonIcon"
data-test-subj="euiMarkdownEditorToolbarButton"
type="button"
>
Expand All @@ -88,7 +88,7 @@ exports[`EuiMarkdownEditor custom plugins are excluded and popover is rendered 1
>
<button
aria-label="Task list"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
class="euiButtonIcon euiButtonIcon--empty euiButtonIcon--xSmall css-19g5rpb-empty-text-EuiButtonIcon"
data-test-subj="euiMarkdownEditorToolbarButton"
type="button"
>
Expand All @@ -108,7 +108,7 @@ exports[`EuiMarkdownEditor custom plugins are excluded and popover is rendered 1
>
<button
aria-label="Quote"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
class="euiButtonIcon euiButtonIcon--empty euiButtonIcon--xSmall css-19g5rpb-empty-text-EuiButtonIcon"
data-test-subj="euiMarkdownEditorToolbarButton"
type="button"
>
Expand All @@ -125,7 +125,7 @@ exports[`EuiMarkdownEditor custom plugins are excluded and popover is rendered 1
>
<button
aria-label="Code"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
class="euiButtonIcon euiButtonIcon--empty euiButtonIcon--xSmall css-19g5rpb-empty-text-EuiButtonIcon"
data-test-subj="euiMarkdownEditorToolbarButton"
type="button"
>
Expand All @@ -142,7 +142,7 @@ exports[`EuiMarkdownEditor custom plugins are excluded and popover is rendered 1
>
<button
aria-label="Link"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
class="euiButtonIcon euiButtonIcon--empty euiButtonIcon--xSmall css-19g5rpb-empty-text-EuiButtonIcon"
data-test-subj="euiMarkdownEditorToolbarButton"
type="button"
>
Expand All @@ -156,7 +156,8 @@ exports[`EuiMarkdownEditor custom plugins are excluded and popover is rendered 1
</span>
</div>
<button
class="euiButtonEmpty euiButtonEmpty--text euiButtonEmpty--small"
class="euiButtonEmpty euiButtonEmpty--small css-15qfgye-empty-text"
data-test-subj="markdown_editor_preview_button"
type="button"
>
<span
Expand Down Expand Up @@ -203,7 +204,7 @@ exports[`EuiMarkdownEditor custom plugins are excluded and popover is rendered 1
>
<button
aria-label="Show markdown help"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--small euiMarkdownEditorFooter__helpButton"
class="euiButtonIcon euiButtonIcon--empty euiButtonIcon--small euiMarkdownEditorFooter__helpButton css-19g5rpb-empty-text-EuiButtonIcon"
title="Syntax help"
type="button"
>
Expand Down Expand Up @@ -406,6 +407,7 @@ exports[`EuiMarkdownEditor is rendered 1`] = `
</div>
<button
class="euiButtonEmpty euiButtonEmpty--small css-15qfgye-empty-text"
data-test-subj="markdown_editor_preview_button"
type="button"
>
<span
Expand Down Expand Up @@ -652,6 +654,7 @@ exports[`EuiMarkdownEditor props autoExpandPreview is rendered with false 1`] =
</div>
<button
class="euiButtonEmpty euiButtonEmpty--small css-15qfgye-empty-text"
data-test-subj="markdown_editor_preview_button"
type="button"
>
<span
Expand Down Expand Up @@ -897,6 +900,7 @@ exports[`EuiMarkdownEditor props height is rendered in full mode 1`] = `
</div>
<button
class="euiButtonEmpty euiButtonEmpty--small css-15qfgye-empty-text"
data-test-subj="markdown_editor_preview_button"
type="button"
>
<span
Expand Down Expand Up @@ -1142,6 +1146,7 @@ exports[`EuiMarkdownEditor props height is rendered with a custom size 1`] = `
</div>
<button
class="euiButtonEmpty euiButtonEmpty--small css-15qfgye-empty-text"
data-test-subj="markdown_editor_preview_button"
type="button"
>
<span
Expand Down Expand Up @@ -1387,6 +1392,7 @@ exports[`EuiMarkdownEditor props maxHeight is rendered with a custom size 1`] =
</div>
<button
class="euiButtonEmpty euiButtonEmpty--small css-15qfgye-empty-text"
data-test-subj="markdown_editor_preview_button"
type="button"
>
<span
Expand Down Expand Up @@ -1641,6 +1647,7 @@ exports[`EuiMarkdownEditor props readOnly is set to true 1`] = `
</div>
<button
class="euiButtonEmpty euiButtonEmpty--small css-13li5q5-empty-disabled"
data-test-subj="markdown_editor_preview_button"
disabled=""
type="button"
>
Expand Down
Loading

0 comments on commit 4f7a811

Please sign in to comment.