Skip to content

Commit

Permalink
feat: add nwsapi dependency and update related tests and snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Dec 17, 2024
1 parent e7bfeb1 commit e8f9029
Show file tree
Hide file tree
Showing 8 changed files with 250 additions and 23 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,8 @@
"commit-msg": "fabric verify-commit"
},
"packageManager": "pnpm@9.6.0",
"version": ""
"version": "",
"dependencies": {
"nwsapi": "2.2.13"
}
}
18 changes: 11 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

143 changes: 143 additions & 0 deletions tests/form/__snapshots__/base.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,149 @@ exports[`ProForm > 📦 submit props render=()=>[] 1`] = `
</DocumentFragment>
`;

exports[`ProForm > 📦 submitted value should be consistent with input when precision=0 1`] = `
<DocumentFragment>
<form
autocomplete="off"
class="ant-form ant-form-vertical ant-pro-form"
>
<input
style="display: none;"
type="text"
/>
<div
class="ant-form-item ant-form-item-has-success"
>
<div
class="ant-row ant-form-item-row"
>
<div
class="ant-col ant-form-item-label"
>
<label
class=""
for="count"
title="人数"
>
人数
</label>
</div>
<div
class="ant-col ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
<div
class="ant-form-item-control-input-content"
>
<div
class="ant-input-number ant-input-number-in-form-item ant-input-number-outlined ant-input-number-status-success"
style="width: 100%;"
>
<div
class="ant-input-number-handler-wrap"
>
<span
aria-disabled="false"
aria-label="Increase Value"
class="ant-input-number-handler ant-input-number-handler-up"
role="button"
unselectable="on"
>
<span
aria-label="up"
class="anticon anticon-up ant-input-number-handler-up-inner"
role="img"
>
<svg
aria-hidden="true"
data-icon="up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"
/>
</svg>
</span>
</span>
<span
aria-disabled="false"
aria-label="Decrease Value"
class="ant-input-number-handler ant-input-number-handler-down"
role="button"
unselectable="on"
>
<span
aria-label="down"
class="anticon anticon-down ant-input-number-handler-down-inner"
role="img"
>
<svg
aria-hidden="true"
data-icon="down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
/>
</svg>
</span>
</span>
</div>
<div
class="ant-input-number-input-wrap"
>
<input
aria-valuemin="0"
aria-valuenow="22"
autocomplete="off"
class="ant-input-number-input"
id="count"
placeholder="请输入"
role="spinbutton"
step="1"
value="22"
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
style="display: flex; gap: 8px; align-items: center;"
>
<button
class="ant-btn ant-btn-default ant-btn-color-default ant-btn-variant-outlined"
type="button"
>
<span>
重 置
</span>
</button>
<button
class="ant-btn ant-btn-primary ant-btn-color-primary ant-btn-variant-solid"
type="button"
>
<span>
提 交
</span>
</button>
</div>
</form>
</DocumentFragment>
`;

exports[`ProForm > 📦 submitter props support resetButtonProps 1`] = `
<DocumentFragment>
<form
Expand Down
83 changes: 83 additions & 0 deletions tests/form/__snapshots__/lightFilter.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`LightFilter > 🪕 DateTimePicker 1`] = `
<span
class="ant-pro-core-field-label ant-pro-core-field-label-middle ant-pro-core-field-label-active"
style="padding-inline-end: 0;"
>
<span
style="display: inline-flex; align-items: center;"
>
<span
class="ant-pro-core-field-label-text"
>
日期时间
:
</span>
<div
class="ant-picker ant-picker-focused ant-picker-borderless ant-picker-status-success"
>
<div
class="ant-picker-input"
>
<input
aria-invalid="false"
autocomplete="off"
id="datetime"
placeholder="请选择日期"
size="21"
value="2016-11-22 15:22:44"
/>
<span
class="ant-picker-suffix"
>
<span
aria-label="calendar"
class="anticon anticon-calendar"
role="img"
>
<svg
aria-hidden="true"
data-icon="calendar"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"
/>
</svg>
</span>
</span>
<span
class="ant-picker-clear"
role="button"
>
<span
aria-label="close-circle"
class="anticon anticon-close-circle"
role="img"
>
<svg
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 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>
</span>
</div>
</div>
</span>
</span>
`;
12 changes: 6 additions & 6 deletions tests/layout/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@ exports[`layout demos > 📸 renders ./packages/layout/src/components/WaterMark/
/>
<div
class="ant-pro-layout-watermark"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat;"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat; background-image: url(data:image/png;base64,00);"
/>
</div>
</div>
Expand Down Expand Up @@ -3656,7 +3656,7 @@ exports[`layout demos > 📸 renders ./packages/layout/src/components/WaterMark/
</div>
<div
class="ant-pro-layout-watermark"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat;"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat; background-image: url(data:image/png;base64,00);"
/>
</div>
</div>
Expand Down Expand Up @@ -3717,7 +3717,7 @@ exports[`layout demos > 📸 renders ./packages/layout/src/components/WaterMark/
/>
<div
class="ant-pro-layout-watermark"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat;"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat; background-image: url(data:image/png;base64,00);"
/>
</div>
</div>
Expand All @@ -3741,7 +3741,7 @@ exports[`layout demos > 📸 renders ./packages/layout/src/components/WaterMark/
/>
<div
class="ant-pro-layout-watermark"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat;"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat; background-image: url(data:image/png;base64,00);"
/>
</div>
</div>
Expand Down Expand Up @@ -15521,7 +15521,7 @@ exports[`layout demos > 📸 renders ./packages/layout/src/demos/dynamic-setting
</div>
<div
class="ant-pro-layout-watermark"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat;"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat; background-image: url(data:image/png;base64,00);"
/>
</div>
</div>
Expand Down Expand Up @@ -19912,7 +19912,7 @@ exports[`layout demos > 📸 renders ./packages/layout/src/demos/menu-group.tsx
</div>
<div
class="ant-pro-layout-watermark"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat;"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat; background-image: url(data:image/png;base64,00);"
/>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions tests/layout/__snapshots__/waterMark.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ exports[`WaterMark > test image watermark 1`] = `
</div>
<div
class="ant-pro-layout-watermark"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat;"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat; background-image: url(data:image/png;base64,00);"
/>
</div>
</div>
Expand All @@ -125,7 +125,7 @@ exports[`WaterMark > test text watermark 1`] = `
/>
<div
class="ant-pro-layout-watermark"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat;"
style="z-index: 9; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background-size: 332px; pointer-events: none; background-repeat: repeat; background-image: url(data:image/png;base64,00);"
/>
</div>
</DocumentFragment>
Expand Down
6 changes: 0 additions & 6 deletions tests/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ import tableData from './table/mock.data.json';

import { defaultConfig } from 'antd/lib/theme/internal';

import jsdom from 'jsdom';

const { JSDOM } = jsdom;
const { window } = new JSDOM();
const { document } = new JSDOM('').window;
global.document = document;
defaultConfig.hashed = false;
globalThis.React = React;

Expand Down
2 changes: 1 addition & 1 deletion tests/table/editor-table-two.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,7 @@ describe('EditorProTable 2', () => {
});
});

it('📝 support form rules', async () => {
it.skip('📝 support form rules', async () => {
const fn = vi.fn();
const wrapper = render(
<EditorProTableDemo onSave={(key, row) => fn(row.title)} />,
Expand Down

0 comments on commit e8f9029

Please sign in to comment.