@dotss/tictoccroc 0.0.0 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LessonNotesSection-a2QNdQtj.js +196 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +109 -52
- package/dist/shared/components/Calendar/Calendar.d.ts +3 -2
- package/dist/shared/components/Calendar/Calendar.mjs +1 -1
- package/dist/shared/components/Carousel/Carousel.d.ts +1 -1
- package/dist/shared/components/Carousel/Carousel.mjs +13 -13
- package/dist/shared/components/Carousel/CarouselSlide/CarouselSlide.d.ts +1 -1
- package/dist/shared/components/Carousel/CarouselSlide/CarouselSlide.mjs +1 -1
- package/dist/shared/components/Image/Image.d.ts +1 -1
- package/dist/shared/components/Image/Image.mjs +94 -93
- package/dist/shared/components/ImageZoomDialog/ImageBlock/ImageBlock.mjs +12 -26
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialog.mjs +77 -98
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogContent/ImageZoomDialogContent.mjs +4 -4
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogFooter/ImageZoomDialogFooter.mjs +4 -4
- package/dist/shared/components/ImageZoomDialog/ImageZoomDialogToolbar/ImageZoomDialogToolbar.mjs +1 -1
- package/dist/shared/components/LoadingAnnouncer/LoadingAnnouncer.d.ts +7 -0
- package/dist/shared/components/LoadingAnnouncer/LoadingAnnouncer.mjs +19 -0
- package/dist/shared/components/LoadingAnnouncer/index.d.ts +3 -0
- package/dist/shared/components/LoadingAnnouncer/index.mjs +4 -0
- package/dist/shared/components/Masonry/Masonry.d.ts +12 -0
- package/dist/shared/components/Masonry/Masonry.mjs +220 -0
- package/dist/shared/components/Masonry/Masonry.utils.d.ts +7 -0
- package/dist/shared/components/Masonry/Masonry.utils.mjs +76 -0
- package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.d.ts +11 -0
- package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.mjs +77 -0
- package/dist/shared/components/Masonry/MasonryBlock/index.d.ts +3 -0
- package/dist/shared/components/Masonry/MasonryBlock/index.mjs +4 -0
- package/dist/shared/components/Masonry/index.d.ts +4 -0
- package/dist/shared/components/Masonry/index.mjs +6 -0
- package/dist/shared/components/Roller/Roller.d.ts +1 -2
- package/dist/shared/components/Roller/Roller.mjs +7 -120
- package/dist/shared/components/Roller/RollerBlock/RollerBlock.d.ts +1 -1
- package/dist/shared/components/Roller/RollerBlock/RollerBlock.mjs +1 -1
- package/dist/shared/components/Roller/index.mjs +3 -3
- package/dist/shared/components/Scheduler/ScheduleBlock/ScheduleBlock.d.ts +2 -5
- package/dist/shared/components/Scheduler/ScheduleBlock/ScheduleBlock.mjs +1 -1
- package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.d.ts +1 -1
- package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.mjs +2 -2
- package/dist/shared/components/Scheduler/Scheduler.d.ts +4 -4
- package/dist/shared/components/Scheduler/Scheduler.mjs +167 -178
- package/dist/shared/components/Swiper/Swiper.d.ts +1 -1
- package/dist/shared/components/Swiper/Swiper.mjs +77 -97
- package/dist/shared/components/Swiper/SwiperBlock/SwiperBlock.d.ts +1 -1
- package/dist/shared/components/Swiper/SwiperBlock/SwiperBlock.mjs +1 -1
- package/dist/shared/components/TimePicker/TimePicker.d.ts +2 -2
- package/dist/shared/components/TimePicker/TimePicker.mjs +1 -1
- package/dist/shared/components/index.d.ts +14 -1
- package/dist/shared/components/index.mjs +40 -28
- package/dist/shared/utils/birthDateToAge/birthDateToAge.test.mjs +9 -10
- package/dist/shared/utils/getDateRange/getDateRange.d.ts +1 -1
- package/dist/shared/utils/getDateRange/getDateRange.test.mjs +27 -28
- package/dist/shared/utils/getImageUrl/getImageUrl.test.mjs +19 -20
- package/dist/shared/utils/getTimeRange/getTimeRange.test.mjs +22 -23
- package/dist/shared/utils/getVimeoId/getVimeoId.test.mjs +11 -12
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/index.mjs +6 -4
- package/dist/shared/utils/isAndroid/isAndroid.test.mjs +9 -10
- package/dist/shared/utils/isApp/isApp.test.mjs +14 -15
- package/dist/shared/utils/isDesktop/isDesktop.test.mjs +8 -9
- package/dist/shared/utils/isServer/isServer.test.mjs +10 -11
- package/dist/shared/utils/objectToQueryString/objectToQueryString.test.mjs +7 -7
- package/dist/shared/utils/parseQueryString/parseQueryString.test.mjs +10 -11
- package/dist/shared/utils/share/index.d.ts +2 -0
- package/dist/shared/utils/share/index.mjs +4 -0
- package/dist/shared/utils/share/share.d.ts +9 -0
- package/dist/shared/utils/share/share.mjs +15 -0
- package/dist/shared/utils/share/share.test.d.ts +1 -0
- package/dist/shared/utils/share/share.test.mjs +31 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/AbilityBadge.d.ts +15 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/AbilityBadge.mjs +441 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/index.d.ts +3 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityBadge/index.mjs +5 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.d.ts +6 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.mjs +111 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.utils.d.ts +6 -0
- package/dist/teacher/profile/components/AbilityCollection/AbilityCollection.utils.mjs +43 -0
- package/dist/teacher/profile/components/AbilityCollection/index.d.ts +5 -0
- package/dist/teacher/profile/components/AbilityCollection/index.mjs +8 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGallery.d.ts +11 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGallery.mjs +101 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.d.ts +8 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/ActivityGalleryItem.mjs +124 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/index.d.ts +3 -0
- package/dist/teacher/profile/components/ActivityGallery/ActivityGalleryItem/index.mjs +4 -0
- package/dist/teacher/profile/components/ActivityGallery/index.d.ts +4 -0
- package/dist/teacher/profile/components/ActivityGallery/index.mjs +6 -0
- package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.d.ts +22 -0
- package/dist/teacher/profile/components/AvailableScheduleSection/AvailableScheduleSection.mjs +179 -0
- package/dist/teacher/profile/components/AvailableScheduleSection/index.d.ts +3 -0
- package/dist/teacher/profile/components/AvailableScheduleSection/index.mjs +4 -0
- package/dist/teacher/profile/components/CareerSection/CareerItem/CareerItem.d.ts +10 -0
- package/dist/teacher/profile/components/CareerSection/CareerItem/CareerItem.mjs +136 -0
- package/dist/teacher/profile/components/CareerSection/CareerItem/index.d.ts +3 -0
- package/dist/teacher/profile/components/CareerSection/CareerItem/index.mjs +4 -0
- package/dist/teacher/profile/components/CareerSection/CareerSection.d.ts +9 -0
- package/dist/teacher/profile/components/CareerSection/CareerSection.mjs +185 -0
- package/dist/teacher/profile/components/CareerSection/index.d.ts +4 -0
- package/dist/teacher/profile/components/CareerSection/index.mjs +6 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationItem/CertificationItem.d.ts +8 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationItem/CertificationItem.mjs +91 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationItem/index.d.ts +3 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationItem/index.mjs +4 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationSection.d.ts +9 -0
- package/dist/teacher/profile/components/CertificationSection/CertificationSection.mjs +152 -0
- package/dist/teacher/profile/components/CertificationSection/index.d.ts +4 -0
- package/dist/teacher/profile/components/CertificationSection/index.mjs +6 -0
- package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.d.ts +9 -0
- package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.mjs +105 -0
- package/dist/teacher/profile/components/EducationSection/EducationItem/index.d.ts +3 -0
- package/dist/teacher/profile/components/EducationSection/EducationItem/index.mjs +4 -0
- package/dist/teacher/profile/components/EducationSection/EducationSection.d.ts +9 -0
- package/dist/teacher/profile/components/EducationSection/EducationSection.mjs +152 -0
- package/dist/teacher/profile/components/EducationSection/index.d.ts +4 -0
- package/dist/teacher/profile/components/EducationSection/index.mjs +6 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNote/LessonNote.d.ts +9 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNote/LessonNote.mjs +54 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNote/index.d.ts +3 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNote/index.mjs +4 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.d.ts +7 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.mjs +8 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.utils.d.ts +4 -0
- package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.utils.mjs +13 -0
- package/dist/teacher/profile/components/LessonNotesSection/index.d.ts +4 -0
- package/dist/teacher/profile/components/LessonNotesSection/index.mjs +6 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/ParentReviewCard.d.ts +10 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/ParentReviewCard.mjs +103 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/index.d.ts +3 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewCard/index.mjs +4 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.d.ts +7 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.mjs +79 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.utils.d.ts +4 -0
- package/dist/teacher/profile/components/ParentReviewSection/ParentReviewSection.utils.mjs +13 -0
- package/dist/teacher/profile/components/ParentReviewSection/index.d.ts +4 -0
- package/dist/teacher/profile/components/ParentReviewSection/index.mjs +6 -0
- package/dist/teacher/profile/components/PreferredActivityKeywordGroup/PreferredActivityKeywordGroup.d.ts +9 -0
- package/dist/teacher/profile/components/PreferredActivityKeywordGroup/PreferredActivityKeywordGroup.mjs +37 -0
- package/dist/teacher/profile/components/PreferredActivityKeywordGroup/index.d.ts +3 -0
- package/dist/teacher/profile/components/PreferredActivityKeywordGroup/index.mjs +4 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.d.ts +8 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.mjs +32 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.utils.d.ts +18 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/PreferredAgeGroup.utils.mjs +14 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/index.d.ts +4 -0
- package/dist/teacher/profile/components/PreferredAgeGroup/index.mjs +6 -0
- package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.d.ts +25 -1
- package/dist/teacher/profile/components/ProfileSummary/ProfileSummary.mjs +413 -5
- package/dist/teacher/profile/components/ProfileSummary/index.d.ts +2 -1
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/StatBadge.d.ts +7 -0
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/StatBadge.mjs +105 -0
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/index.d.ts +3 -0
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadge/index.mjs +4 -0
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadgeCollection.d.ts +6 -0
- package/dist/teacher/profile/components/StatBadgeCollection/StatBadgeCollection.mjs +28 -0
- package/dist/teacher/profile/components/StatBadgeCollection/index.d.ts +4 -0
- package/dist/teacher/profile/components/StatBadgeCollection/index.mjs +6 -0
- package/dist/teacher/profile/components/index.d.ts +24 -0
- package/dist/teacher/profile/components/index.mjs +46 -0
- package/package.json +2 -2
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { describe as t, test as u, expect as l } from "vitest";
|
|
2
1
|
import e from "./getTimeRange.mjs";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
l
|
|
2
|
+
describe("getTimeRange", () => {
|
|
3
|
+
test("시작 시간과 종료 시간 사이의 시간을 배열로 반환한다.", () => {
|
|
4
|
+
const l = e(5.5, 10.5);
|
|
5
|
+
expect(l).toEqual([
|
|
7
6
|
{ label: "05:30", value: 5.5 },
|
|
8
7
|
{ label: "06:00", value: 6 },
|
|
9
8
|
{ label: "06:30", value: 6.5 },
|
|
@@ -16,18 +15,18 @@ t("getTimeRange", () => {
|
|
|
16
15
|
{ label: "10:00", value: 10 },
|
|
17
16
|
{ label: "10:30", value: 10.5 }
|
|
18
17
|
]);
|
|
19
|
-
}),
|
|
20
|
-
|
|
21
|
-
}),
|
|
22
|
-
|
|
23
|
-
}),
|
|
24
|
-
|
|
25
|
-
}),
|
|
26
|
-
const
|
|
18
|
+
}), test("시작 시간이 종료 시간보다 크면 빈 배열을 반환한다.", () => {
|
|
19
|
+
expect(e(10.5, 5.5)).toEqual([]);
|
|
20
|
+
}), test("음수 시간이 포함되면 빈 배열을 반환한다.", () => {
|
|
21
|
+
expect(e(-1, 5.5)).toEqual([]), expect(e(5.5, -1)).toEqual([]);
|
|
22
|
+
}), test("step이 0 이하면 빈 배열을 반환한다.", () => {
|
|
23
|
+
expect(e(5.5, 10.5, { step: 0 })).toEqual([]), expect(e(5.5, 10.5, { step: -0.5 })).toEqual([]);
|
|
24
|
+
}), test("minTime과 maxTime을 적용할 수 있다.", () => {
|
|
25
|
+
const l = e(5.5, 10.5, {
|
|
27
26
|
minTime: 6,
|
|
28
27
|
maxTime: 9.5
|
|
29
28
|
});
|
|
30
|
-
l
|
|
29
|
+
expect(l).toEqual([
|
|
31
30
|
{ label: "06:00", value: 6 },
|
|
32
31
|
{ label: "06:30", value: 6.5 },
|
|
33
32
|
{ label: "07:00", value: 7 },
|
|
@@ -37,16 +36,16 @@ t("getTimeRange", () => {
|
|
|
37
36
|
{ label: "09:00", value: 9 },
|
|
38
37
|
{ label: "09:30", value: 9.5 }
|
|
39
38
|
]);
|
|
40
|
-
}),
|
|
41
|
-
const
|
|
42
|
-
l
|
|
39
|
+
}), test("step을 조정할 수 있다.", () => {
|
|
40
|
+
const l = e(5.5, 7.5, { step: 1 });
|
|
41
|
+
expect(l).toEqual([
|
|
43
42
|
{ label: "05:30", value: 5.5 },
|
|
44
43
|
{ label: "06:30", value: 6.5 },
|
|
45
44
|
{ label: "07:30", value: 7.5 }
|
|
46
45
|
]);
|
|
47
|
-
}),
|
|
48
|
-
const
|
|
49
|
-
l
|
|
46
|
+
}), test("pairs 옵션을 사용하면 연속된 시간 쌍을 반환한다.", () => {
|
|
47
|
+
const l = e(8.5, 9.5, { pairs: !0 });
|
|
48
|
+
expect(l).toEqual([
|
|
50
49
|
{ label: "08:30", value: 8.5 },
|
|
51
50
|
// 첫 번째 쌍의 시작 시간
|
|
52
51
|
{ label: "09:00", value: 9 },
|
|
@@ -56,13 +55,13 @@ t("getTimeRange", () => {
|
|
|
56
55
|
{ label: "09:30", value: 9.5 }
|
|
57
56
|
// 두 번째 쌍의 종료 시간
|
|
58
57
|
]);
|
|
59
|
-
}),
|
|
60
|
-
const
|
|
58
|
+
}), test("pairs 옵션과 다른 옵션을 함께 사용할 수 있다.", () => {
|
|
59
|
+
const l = e(8.5, 10.5, {
|
|
61
60
|
pairs: !0,
|
|
62
61
|
minTime: 9,
|
|
63
62
|
maxTime: 10
|
|
64
63
|
});
|
|
65
|
-
l
|
|
64
|
+
expect(l).toEqual([
|
|
66
65
|
{ label: "09:00", value: 9 },
|
|
67
66
|
// 첫 번째 쌍의 시작 시간
|
|
68
67
|
{ label: "09:30", value: 9.5 },
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { describe as c, expect as o } from "vitest";
|
|
2
1
|
import e from "./getVimeoId.mjs";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}),
|
|
7
|
-
|
|
8
|
-
}),
|
|
9
|
-
|
|
10
|
-
}),
|
|
11
|
-
|
|
12
|
-
}),
|
|
13
|
-
|
|
2
|
+
describe("getVimeoId", (o) => {
|
|
3
|
+
o("유효한 Vimeo URL에서 ID를 추출한다.", () => {
|
|
4
|
+
expect(e("https://vimeo.com/123456789")).toBe(123456789);
|
|
5
|
+
}), o("URL이 비어있으면 0을 반환한다.", () => {
|
|
6
|
+
expect(e("")).toBe(0);
|
|
7
|
+
}), o("Vimeo URL이 아니면 0을 반환한다.", () => {
|
|
8
|
+
expect(e("https://youtube.com/watch?v=abcdef")).toBe(0);
|
|
9
|
+
}), o("ID가 포함되지 않은 Vimeo URL이면 0을 반환한다.", () => {
|
|
10
|
+
expect(e("https://vimeo.com/")).toBe(0);
|
|
11
|
+
}), o("올바르지 않은 URL 형식이면 0을 반환한다.", () => {
|
|
12
|
+
expect(e("")).toBe(0), expect(e(void 0)).toBe(0), expect(e("parent.tictoccroc.com")).toBe(0), expect(e("parent.tictoccroc.com///")).toBe(0), expect(e("tictocisland")).toBe(0);
|
|
14
13
|
});
|
|
15
14
|
});
|
|
@@ -9,3 +9,4 @@ export { default as birthDateToAge } from './birthDateToAge';
|
|
|
9
9
|
export { default as objectToQueryString } from './objectToQueryString';
|
|
10
10
|
export { default as getVimeoId } from './getVimeoId';
|
|
11
11
|
export { default as parseQueryString } from './parseQueryString';
|
|
12
|
+
export { default as share } from './share';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as t } from "./getImageUrl/getImageUrl.mjs";
|
|
2
2
|
import { default as o } from "./isServer/isServer.mjs";
|
|
3
3
|
import { default as s } from "./getTimeRange/getTimeRange.mjs";
|
|
4
4
|
import { default as d } from "./getDateRange/getDateRange.mjs";
|
|
@@ -8,11 +8,12 @@ import { default as i } from "./isDesktop/isDesktop.mjs";
|
|
|
8
8
|
import { default as A } from "./birthDateToAge/birthDateToAge.mjs";
|
|
9
9
|
import { default as S } from "./objectToQueryString/objectToQueryString.mjs";
|
|
10
10
|
import { default as b } from "./getVimeoId/getVimeoId.mjs";
|
|
11
|
-
import { default as
|
|
11
|
+
import { default as y } from "./parseQueryString/parseQueryString.mjs";
|
|
12
|
+
import { default as Q } from "./share/share.mjs";
|
|
12
13
|
export {
|
|
13
14
|
A as birthDateToAge,
|
|
14
15
|
d as getDateRange,
|
|
15
|
-
|
|
16
|
+
t as getImageUrl,
|
|
16
17
|
s as getTimeRange,
|
|
17
18
|
b as getVimeoId,
|
|
18
19
|
u as isAndroid,
|
|
@@ -20,5 +21,6 @@ export {
|
|
|
20
21
|
i as isDesktop,
|
|
21
22
|
o as isServer,
|
|
22
23
|
S as objectToQueryString,
|
|
23
|
-
|
|
24
|
+
y as parseQueryString,
|
|
25
|
+
Q as share
|
|
24
26
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
e.stubGlobal("navigator", {
|
|
1
|
+
import e from "./isAndroid.mjs";
|
|
2
|
+
describe("isAndroid", () => {
|
|
3
|
+
afterEach(() => {
|
|
4
|
+
vi.restoreAllMocks();
|
|
5
|
+
}), test("Android userAgent일 때 true를 반환한다.", () => {
|
|
6
|
+
vi.stubGlobal("navigator", { userAgent: "Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36" }), expect(e()).toBe(!0);
|
|
7
|
+
}), test("Android가 아닌 userAgent일 때 false를 반환한다.", () => {
|
|
8
|
+
vi.stubGlobal("navigator", {
|
|
10
9
|
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/537.36"
|
|
11
|
-
}),
|
|
10
|
+
}), expect(e()).toBe(!1);
|
|
12
11
|
});
|
|
13
12
|
});
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}), o("앱 환경에서는 true를 반환한다.", () => {
|
|
1
|
+
import e from "./isApp.mjs";
|
|
2
|
+
describe("isApp", () => {
|
|
3
|
+
beforeEach(() => {
|
|
4
|
+
vi.stubGlobal("document", {}), vi.stubGlobal("window", {});
|
|
5
|
+
}), afterEach(() => {
|
|
6
|
+
vi.restoreAllMocks();
|
|
7
|
+
}), test("웹 환경에서는 false를 반환한다.", () => {
|
|
8
|
+
expect(e()).toBe(!1);
|
|
9
|
+
}), test("앱 환경에서는 true를 반환한다.", () => {
|
|
11
10
|
Object.defineProperty(window, "flutter_inappwebview", {
|
|
12
11
|
value: {
|
|
13
12
|
callHandler: () => {
|
|
14
13
|
}
|
|
15
14
|
},
|
|
16
15
|
configurable: !0
|
|
17
|
-
}),
|
|
18
|
-
}),
|
|
19
|
-
|
|
20
|
-
}),
|
|
21
|
-
|
|
16
|
+
}), expect(e()).toBe(!0);
|
|
17
|
+
}), test("document가 존재하지 않으면 false를 반환한다.", () => {
|
|
18
|
+
vi.stubGlobal("document", void 0), expect(e()).toBe(!1);
|
|
19
|
+
}), test("window가 존재하지 않으면 false를 반환한다.", () => {
|
|
20
|
+
vi.stubGlobal("window", void 0), expect(e()).toBe(!1);
|
|
22
21
|
});
|
|
23
22
|
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
e.stubGlobal("navigator", { userAgent: "windows" }), t(o()).toBe(!0), e.stubGlobal("navigator", { userAgent: "mac" }), t(o()).toBe(!0), e.stubGlobal("navigator", { userAgent: "linux" }), t(o()).toBe(!0);
|
|
1
|
+
import e from "./isDesktop.mjs";
|
|
2
|
+
describe("isDesktop", (t) => {
|
|
3
|
+
afterEach(() => {
|
|
4
|
+
vi.restoreAllMocks();
|
|
5
|
+
}), t("모바일 환경인 경우 false를 반환한다.", () => {
|
|
6
|
+
vi.stubGlobal("navigator", { userAgent: "android" }), expect(e()).toBe(!1), vi.stubGlobal("navigator", { userAgent: "iphone" }), expect(e()).toBe(!1), vi.stubGlobal("navigator", { userAgent: "ipad" }), expect(e()).toBe(!1), vi.stubGlobal("navigator", { userAgent: "mobile" }), expect(e()).toBe(!1);
|
|
7
|
+
}), t("데스크탑 환경인 경우 true를 반환한다.", () => {
|
|
8
|
+
vi.stubGlobal("navigator", { userAgent: "windows" }), expect(e()).toBe(!0), vi.stubGlobal("navigator", { userAgent: "mac" }), expect(e()).toBe(!0), vi.stubGlobal("navigator", { userAgent: "linux" }), expect(e()).toBe(!0);
|
|
10
9
|
});
|
|
11
10
|
});
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
e.stubGlobal("window", void 0), r(t()).toBe(!0);
|
|
1
|
+
import o from "./isServer.mjs";
|
|
2
|
+
describe("isServer", (e) => {
|
|
3
|
+
afterEach(() => {
|
|
4
|
+
vi.restoreAllMocks();
|
|
5
|
+
}), e("document가 존재하면 false를 반환한다.", () => {
|
|
6
|
+
vi.stubGlobal("document", {}), expect(o()).toBe(!1);
|
|
7
|
+
}), e("document가 존재하지 않으면 true를 반환한다.", () => {
|
|
8
|
+
vi.stubGlobal("document", void 0), expect(o()).toBe(!0);
|
|
9
|
+
}), e("window가 존재하지 않으면 true를 반환한다.", () => {
|
|
10
|
+
vi.stubGlobal("window", void 0), expect(o()).toBe(!0);
|
|
12
11
|
});
|
|
13
12
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
e(
|
|
1
|
+
import e from "./objectToQueryString.mjs";
|
|
2
|
+
describe("convertObjectToQueryString", (t) => {
|
|
3
|
+
t("object 타입이 들어왔을 때 query string으로 변환한다.", () => {
|
|
4
|
+
const c = { a: 1, b: !0, c: "test", d: void 0, e: null, f: { fa: 1 } };
|
|
5
|
+
expect(e(c)).toEqual(
|
|
6
6
|
"?a=1&b=true&c=test&d=undefined&e=null&f=%5Bobject+Object%5D"
|
|
7
7
|
);
|
|
8
|
-
}),
|
|
9
|
-
e(
|
|
8
|
+
}), t("변환할 수 없는 타입이 들어온 경우 빈 문자열을 반환한다.", () => {
|
|
9
|
+
expect(e(null)).toEqual(""), expect(e(void 0)).toEqual("");
|
|
10
10
|
});
|
|
11
11
|
});
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
e(a("key1=value1&key2=value2")).toEqual({
|
|
1
|
+
import e from "./parseQueryString.mjs";
|
|
2
|
+
describe("parseQueryStrings", (a) => {
|
|
3
|
+
a("단일 키:값 쌍을 넘겼을 떄 Object를 리턴한다.", () => {
|
|
4
|
+
expect(e("key=value")).toEqual({ key: "value" });
|
|
5
|
+
}), a("두 개 이상의 키:값 쌍을 넘겼을 때 Object를 리턴한다.", () => {
|
|
6
|
+
expect(e("key1=value1&key2=value2")).toEqual({
|
|
8
7
|
key1: "value1",
|
|
9
8
|
key2: "value2"
|
|
10
9
|
});
|
|
11
|
-
}),
|
|
12
|
-
e(
|
|
13
|
-
}),
|
|
14
|
-
e(
|
|
10
|
+
}), a("빈 값을 넘겼을 때 빈 Object를 리턴한다.", () => {
|
|
11
|
+
expect(e()).toEqual({}), expect(e(void 0)).toEqual({}), expect(e("")).toEqual({});
|
|
12
|
+
}), a("유효하지 않은 값을 넘겼을 때에도 Object를 리턴한다.", () => {
|
|
13
|
+
expect(e("key=")).toEqual({ key: "" }), expect(e("key")).toEqual({ key: "" }), expect(e("=value")).toEqual({ "": "value" });
|
|
15
14
|
});
|
|
16
15
|
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function a(n, { onSuccess: t, onError: e } = {}) {
|
|
2
|
+
if (window.navigator.canShare) {
|
|
3
|
+
if (!window.navigator.canShare(n)) {
|
|
4
|
+
typeof e == "function" && e();
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
} else {
|
|
8
|
+
typeof e == "function" && e();
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
return window.navigator.share(n).then(t).catch(e);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
a as default
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import o from "./share.mjs";
|
|
2
|
+
describe("share", () => {
|
|
3
|
+
const a = { title: "test", text: "test", url: "test" }, t = vi.fn(() => !0), e = vi.fn(() => !0), r = vi.fn(async () => !0).mockResolvedValue(!0);
|
|
4
|
+
afterEach(() => {
|
|
5
|
+
vi.restoreAllMocks();
|
|
6
|
+
}), test("navigator에 canShare가 없는 경우 onError를 호출한다.", () => {
|
|
7
|
+
vi.stubGlobal("window", { navigator: { share: r } }), o(a, { onError: e }), expect(e).toHaveBeenCalledTimes(1);
|
|
8
|
+
}), test("navigator.canShare가 false를 반환하는 경우 onError를 호출한다.", () => {
|
|
9
|
+
vi.stubGlobal("window", {
|
|
10
|
+
navigator: {
|
|
11
|
+
canShare: () => !1,
|
|
12
|
+
share: r
|
|
13
|
+
}
|
|
14
|
+
}), o(a, { onError: e }), expect(e).toHaveBeenCalledTimes(1);
|
|
15
|
+
}), test("navigator.canShare가 true를 반환하는 경우 navigator.share를 호출하고 onSuccess를 실행한다.", async () => {
|
|
16
|
+
vi.stubGlobal("window", {
|
|
17
|
+
navigator: {
|
|
18
|
+
canShare: () => !0,
|
|
19
|
+
share: r
|
|
20
|
+
}
|
|
21
|
+
}), await o(a, { onSuccess: t, onError: e }), expect(r).toHaveBeenCalledWith(a), expect(t).toHaveBeenCalledTimes(1), expect(e).not.toHaveBeenCalled();
|
|
22
|
+
}), test("navigator.share가 실패하면 onSucces를 호출하지 않는다.", async () => {
|
|
23
|
+
const n = vi.fn().mockRejectedValue(new Error("Share failed"));
|
|
24
|
+
vi.stubGlobal("window", {
|
|
25
|
+
navigator: {
|
|
26
|
+
canShare: () => !0,
|
|
27
|
+
share: n
|
|
28
|
+
}
|
|
29
|
+
}), await o(a, { onSuccess: t, onError: e }), expect(t).not.toHaveBeenCalled();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FlexboxProps } from 'node_modules/@dotss/ui/Flexbox/Flexbox';
|
|
2
|
+
export interface AbilityBadgeProps extends FlexboxProps {
|
|
3
|
+
name: string;
|
|
4
|
+
iconBasePath: string;
|
|
5
|
+
completed: boolean;
|
|
6
|
+
detail: {
|
|
7
|
+
open?: boolean;
|
|
8
|
+
label: string;
|
|
9
|
+
description: string;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
onClickApply?: () => void;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
declare function AbillityBadge({ name, iconBasePath, completed, detail: { open, label, description, onClose, onClickApply }, ...props }: AbilityBadgeProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default AbillityBadge;
|