From 705341e3943e83a6d0977c0dfa353f2b36010d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E9=9B=BE=E4=B8=89=E8=AF=AD?= <32354856+baiwusanyu-c@users.noreply.github.com> Date: Mon, 15 Apr 2024 13:21:08 +0800 Subject: [PATCH] test: added KTour unit test (#436) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip: init KTour component * wip: complete KTour component placement、mask、current zIndex、open props * test: added KTour unit test * test: added KTour unit test --- .../__snapshots__/calendar.spec.ts.snap | 24 -- .../__snapshots__/carousel.spec.ts.snap | 2 +- .../Carousel/__test__/fixture/custom.svelte | 6 +- .../__test__/__snapshots__/tour.spec.ts.snap | 49 +++ components/Tour/__test__/fixture/open.svelte | 27 ++ .../Tour/__test__/fixture/slots.btn.svelte | 28 ++ .../Tour/__test__/fixture/slots.close.svelte | 29 ++ .../Tour/__test__/fixture/slots.descr.svelte | 30 ++ .../Tour/__test__/fixture/slots.footer.svelte | 30 ++ .../__test__/fixture/slots.indicator.svelte | 29 ++ .../Tour/__test__/fixture/slots.title.svelte | 29 ++ components/Tour/__test__/tour.spec.ts | 368 +++++++++++++++++- components/Tour/src/index.svelte | 36 +- components/Tour/src/types.d.ts | 26 -- 14 files changed, 643 insertions(+), 70 deletions(-) create mode 100644 components/Tour/__test__/__snapshots__/tour.spec.ts.snap create mode 100644 components/Tour/__test__/fixture/open.svelte create mode 100644 components/Tour/__test__/fixture/slots.btn.svelte create mode 100644 components/Tour/__test__/fixture/slots.close.svelte create mode 100644 components/Tour/__test__/fixture/slots.descr.svelte create mode 100644 components/Tour/__test__/fixture/slots.footer.svelte create mode 100644 components/Tour/__test__/fixture/slots.indicator.svelte create mode 100644 components/Tour/__test__/fixture/slots.title.svelte diff --git a/components/Calendar/__test__/__snapshots__/calendar.spec.ts.snap b/components/Calendar/__test__/__snapshots__/calendar.spec.ts.snap index ea4e53a1..8a50640b 100644 --- a/components/Calendar/__test__/__snapshots__/calendar.spec.ts.snap +++ b/components/Calendar/__test__/__snapshots__/calendar.spec.ts.snap @@ -35,34 +35,10 @@ exports[`Test: KCalendar > events: select 3`] = ` } `; -exports[`Test: KCalendar > props: cls 1`] = `"
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
31 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
Jan | Feb | Mar |
Apr | May | Jun |
Jul | Aug | Sep |
Oct | Nov | Dec |
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
31 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
周一 | 周二 | 周三 | 周四 | 周五 | 周六 | 周日 |
---|---|---|---|---|---|---|
31 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
一月 | 二月 | 三月 |
四月 | 五月 | 六月 |
七月 | 八月 | 九月 |
十月 | 十一月 | 十二月 |
Jan | Feb | Mar |
Apr | May | Jun |
Jul | Aug | Sep |
Oct | Nov | Dec |
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
31 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |