Skip to content

Commit

Permalink
test: 单测修复
Browse files Browse the repository at this point in the history
  • Loading branch information
wjgogogo committed Jan 19, 2024
1 parent 1d28d21 commit 4b8dcd1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ GuiIcon {
"zIndex": 0,
},
"destroyed": false,
"iconImageShape": ImageShape1 {
"iconImageShape": ImageShape {
"_events": Object {},
"attrs": Object {
"animable": true,
Expand Down Expand Up @@ -98,7 +98,7 @@ GuiIcon {
"zIndex": 0,
},
"destroyed": false,
"iconImageShape": ImageShape1 {
"iconImageShape": ImageShape {
"_events": Object {},
"attrs": Object {
"animable": true,
Expand Down Expand Up @@ -168,7 +168,7 @@ GuiIcon {
"zIndex": 0,
},
"destroyed": false,
"iconImageShape": ImageShape1 {
"iconImageShape": ImageShape {
"_events": Object {},
"attrs": Object {
"animable": true,
Expand Down Expand Up @@ -238,7 +238,7 @@ GuiIcon {
"zIndex": 0,
},
"destroyed": false,
"iconImageShape": ImageShape1 {
"iconImageShape": ImageShape {
"_events": Object {},
"attrs": Object {
"animable": true,
Expand Down Expand Up @@ -308,7 +308,7 @@ GuiIcon {
"zIndex": 0,
},
"destroyed": false,
"iconImageShape": ImageShape1 {
"iconImageShape": ImageShape {
"_events": Object {},
"attrs": Object {
"animable": true,
Expand Down Expand Up @@ -378,7 +378,7 @@ GuiIcon {
"zIndex": 0,
},
"destroyed": false,
"iconImageShape": ImageShape1 {
"iconImageShape": ImageShape {
"_events": Object {},
"attrs": Object {
"animable": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ exports[`Pagination Tests should receive antd <Pagination/> component extra prop
>
<ul
class="ant-pagination"
unselectable="unselectable"
>
<li
aria-disabled="false"
Expand Down Expand Up @@ -126,8 +125,7 @@ exports[`Pagination Tests should render locale text for { locale: 'en_US', page:
class="antv-s2-pagination"
>
<ul
class="ant-pagination mini"
unselectable="unselectable"
class="ant-pagination ant-pagination-mini"
>
<li
aria-disabled="true"
Expand Down Expand Up @@ -299,8 +297,7 @@ exports[`Pagination Tests should render locale text for { locale: 'zh_CN', page:
class="antv-s2-pagination"
>
<ul
class="ant-pagination mini"
unselectable="unselectable"
class="ant-pagination ant-pagination-mini"
>
<li
aria-disabled="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ exports[`DrillDown Component Tests should render component 1`] = `
aria-hidden="true"
data-icon="close-circle"
fill="currentColor"
fill-rule="evenodd"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
d="M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"
/>
</svg>
</span>
Expand Down Expand Up @@ -135,7 +136,7 @@ exports[`DrillDown Component Tests should render component 1`] = `
<div
class="ant-empty-description"
>
No Data
No data
</div>
</div>
extra
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ exports[`Pagination Component Tests should render component 1`] = `
class="antv-s2-pagination"
>
<ul
class="ant-pagination mini"
unselectable="unselectable"
class="ant-pagination ant-pagination-mini"
>
<li
aria-disabled="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ exports[`<SheetComponent/> Tests Render Tests should render editable sheet by sn
class="antv-s2-pagination"
>
<ul
class="ant-pagination mini"
unselectable="unselectable"
class="ant-pagination ant-pagination-mini"
>
<li
aria-disabled="true"
Expand Down Expand Up @@ -355,8 +354,7 @@ exports[`<SheetComponent/> Tests Render Tests should render gridAnalysis sheet b
class="antv-s2-pagination"
>
<ul
class="ant-pagination mini"
unselectable="unselectable"
class="ant-pagination ant-pagination-mini"
>
<li
aria-disabled="true"
Expand Down Expand Up @@ -607,8 +605,7 @@ exports[`<SheetComponent/> Tests Render Tests should render pivot sheet by snaps
class="antv-s2-pagination"
>
<ul
class="ant-pagination mini"
unselectable="unselectable"
class="ant-pagination ant-pagination-mini"
>
<li
aria-disabled="true"
Expand Down Expand Up @@ -859,8 +856,7 @@ exports[`<SheetComponent/> Tests Render Tests should render strategy sheet by sn
class="antv-s2-pagination"
>
<ul
class="ant-pagination mini"
unselectable="unselectable"
class="ant-pagination ant-pagination-mini"
>
<li
aria-disabled="true"
Expand Down Expand Up @@ -1111,8 +1107,7 @@ exports[`<SheetComponent/> Tests Render Tests should render table sheet by snaps
class="antv-s2-pagination"
>
<ul
class="ant-pagination mini"
unselectable="unselectable"
class="ant-pagination ant-pagination-mini"
>
<li
aria-disabled="true"
Expand Down
4 changes: 3 additions & 1 deletion packages/s2-react/src/hooks/useLoading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import React from 'react';
import { SpreadSheet, S2Event } from '@antv/s2';

export const useLoading = (s2: SpreadSheet, loadingFromProps?: boolean) => {
const [loading, setLoading] = React.useState<boolean>(loadingFromProps);
const [loading, setLoading] = React.useState<boolean>(
loadingFromProps ?? false,
);

React.useEffect(() => {
s2?.on(S2Event.LAYOUT_BEFORE_RENDER, () => {
Expand Down

0 comments on commit 4b8dcd1

Please sign in to comment.