Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(poup): mounted后才显示,避免ssr下mismatch #1654

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
chore: update snapshot
novlan1 committed Nov 27, 2024
commit bd19ba719c4573ce7f7fd6c16d95fd6b4175be66
4 changes: 2 additions & 2 deletions src/calendar/__test__/index.test.jsx
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@
const onConfirm = vi.fn((e) => {
time.value = dayFormat(e, character);
});
const wrapper = await mount(
const wrapper = mount(
<Calendar
visible={true}
value={value}
@@ -95,7 +95,7 @@
await $button.trigger('click');

// TODO:区间选择器时,返回的应该是数组,但测试环境下只有单条 Date 对象数据
expect(time.value).toEqual([year, month + 1, selectLastIndex + 1].join(character));

Check failure on line 98 in src/calendar/__test__/index.test.jsx

GitHub Actions / call-test-build / test

src/calendar/__test__/index.test.jsx > calendar > props > : type

AssertionError: expected '2022-1-15' to deeply equal '2022-1-9' Expected: "2022-1-9" Received: "2022-1-15" ❯ src/calendar/__test__/index.test.jsx:98:26
// TODO: && type = 'multiple'

// 覆盖 type = '' 情况
@@ -168,7 +168,7 @@
const onSelect = vi.fn((e) => {
selectTime.value = dayFormat(e, character);
});
const wrapper = await mount(
const wrapper = mount(
<Calendar
visible={true}
value={value}
@@ -189,7 +189,7 @@
const $button = wrapper.findComponent(Button);
await $button.trigger('click');
expect(onConfirm).toHaveBeenCalledTimes(1);
expect(selectTime).toEqual(time);

Check failure on line 192 in src/calendar/__test__/index.test.jsx

GitHub Actions / call-test-build / test

src/calendar/__test__/index.test.jsx > calendar > events > : onSelect

AssertionError: expected RefImpl{ __v_isShallow: false, …(4) } to deeply equal RefImpl{ __v_isShallow: false, …(4) } - Expected + Received RefImpl { "__v_isRef": true, "__v_isShallow": false, - "_rawValue": "2022-1-15", - "_value": "2022-1-15", + "_rawValue": "2022-1-3", + "_value": "2022-1-3", "dep": undefined, } ❯ src/calendar/__test__/index.test.jsx:192:26
novlan1 marked this conversation as resolved.
Show resolved Hide resolved
});
});
});