@dotss/tictoccroc 0.0.3 → 0.0.5
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/index.mjs +78 -77
- package/dist/shared/components/Masonry/Masonry.mjs +111 -103
- package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.d.ts +1 -1
- package/dist/shared/components/Masonry/MasonryBlock/MasonryBlock.mjs +103 -86
- package/dist/shared/components/MediaDialog/MediaBlock/MediaBlock.mjs +1 -1
- package/dist/shared/components/MediaDialog/MediaDialog.mjs +121 -118
- package/dist/shared/components/Roller/Roller.mjs +131 -7
- package/dist/shared/components/Roller/index.mjs +3 -3
- package/dist/shared/components/Scheduler/ScheduleEvent/ScheduleEvent.mjs +1 -1
- package/dist/shared/components/Swiper/Swiper.mjs +1 -1
- package/dist/shared/components/index.mjs +3 -3
- package/dist/teacher/profile/components/CertificationSection/CertificationItem/CertificationItem.mjs +1 -1
- package/dist/teacher/profile/components/EducationSection/EducationItem/EducationItem.mjs +1 -1
- package/dist/teacher/profile/components/LessonNotesSection/LessonNotesSection.mjs +79 -6
- package/dist/teacher/profile/components/LessonNotesSection/index.mjs +3 -3
- package/dist/teacher/profile/components/index.mjs +5 -5
- package/package.json +2 -2
- package/dist/LessonNotesSection-Bg1DHFxg.js +0 -208
- package/dist/shared/utils/birthDateToAge/birthDateToAge.test.mjs +0 -11
- package/dist/shared/utils/getDateRange/getDateRange.test.mjs +0 -60
- package/dist/shared/utils/getImageUrl/getImageUrl.test.mjs +0 -27
- package/dist/shared/utils/getTimeRange/getTimeRange.test.mjs +0 -75
- package/dist/shared/utils/getVimeoId/getVimeoId.test.mjs +0 -14
- package/dist/shared/utils/isAndroid/isAndroid.test.mjs +0 -12
- package/dist/shared/utils/isApp/isApp.test.mjs +0 -22
- package/dist/shared/utils/isDesktop/isDesktop.test.mjs +0 -10
- package/dist/shared/utils/isServer/isServer.test.mjs +0 -12
- package/dist/shared/utils/objectToQueryString/objectToQueryString.test.mjs +0 -11
- package/dist/shared/utils/parseQueryString/parseQueryString.test.mjs +0 -15
- package/dist/shared/utils/share/share.test.mjs +0 -31
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import e from "./getTimeRange.mjs";
|
|
2
|
-
describe("getTimeRange", () => {
|
|
3
|
-
test("시작 시간과 종료 시간 사이의 시간을 배열로 반환한다.", () => {
|
|
4
|
-
const l = e(5.5, 10.5);
|
|
5
|
-
expect(l).toEqual([
|
|
6
|
-
{ label: "05:30", value: 5.5 },
|
|
7
|
-
{ label: "06:00", value: 6 },
|
|
8
|
-
{ label: "06:30", value: 6.5 },
|
|
9
|
-
{ label: "07:00", value: 7 },
|
|
10
|
-
{ label: "07:30", value: 7.5 },
|
|
11
|
-
{ label: "08:00", value: 8 },
|
|
12
|
-
{ label: "08:30", value: 8.5 },
|
|
13
|
-
{ label: "09:00", value: 9 },
|
|
14
|
-
{ label: "09:30", value: 9.5 },
|
|
15
|
-
{ label: "10:00", value: 10 },
|
|
16
|
-
{ label: "10:30", value: 10.5 }
|
|
17
|
-
]);
|
|
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, {
|
|
26
|
-
minTime: 6,
|
|
27
|
-
maxTime: 9.5
|
|
28
|
-
});
|
|
29
|
-
expect(l).toEqual([
|
|
30
|
-
{ label: "06:00", value: 6 },
|
|
31
|
-
{ label: "06:30", value: 6.5 },
|
|
32
|
-
{ label: "07:00", value: 7 },
|
|
33
|
-
{ label: "07:30", value: 7.5 },
|
|
34
|
-
{ label: "08:00", value: 8 },
|
|
35
|
-
{ label: "08:30", value: 8.5 },
|
|
36
|
-
{ label: "09:00", value: 9 },
|
|
37
|
-
{ label: "09:30", value: 9.5 }
|
|
38
|
-
]);
|
|
39
|
-
}), test("step을 조정할 수 있다.", () => {
|
|
40
|
-
const l = e(5.5, 7.5, { step: 1 });
|
|
41
|
-
expect(l).toEqual([
|
|
42
|
-
{ label: "05:30", value: 5.5 },
|
|
43
|
-
{ label: "06:30", value: 6.5 },
|
|
44
|
-
{ label: "07:30", value: 7.5 }
|
|
45
|
-
]);
|
|
46
|
-
}), test("pairs 옵션을 사용하면 연속된 시간 쌍을 반환한다.", () => {
|
|
47
|
-
const l = e(8.5, 9.5, { pairs: !0 });
|
|
48
|
-
expect(l).toEqual([
|
|
49
|
-
{ label: "08:30", value: 8.5 },
|
|
50
|
-
// 첫 번째 쌍의 시작 시간
|
|
51
|
-
{ label: "09:00", value: 9 },
|
|
52
|
-
// 첫 번째 쌍의 종료 시간
|
|
53
|
-
{ label: "09:00", value: 9 },
|
|
54
|
-
// 두 번째 쌍의 시작 시간
|
|
55
|
-
{ label: "09:30", value: 9.5 }
|
|
56
|
-
// 두 번째 쌍의 종료 시간
|
|
57
|
-
]);
|
|
58
|
-
}), test("pairs 옵션과 다른 옵션을 함께 사용할 수 있다.", () => {
|
|
59
|
-
const l = e(8.5, 10.5, {
|
|
60
|
-
pairs: !0,
|
|
61
|
-
minTime: 9,
|
|
62
|
-
maxTime: 10
|
|
63
|
-
});
|
|
64
|
-
expect(l).toEqual([
|
|
65
|
-
{ label: "09:00", value: 9 },
|
|
66
|
-
// 첫 번째 쌍의 시작 시간
|
|
67
|
-
{ label: "09:30", value: 9.5 },
|
|
68
|
-
// 첫 번째 쌍의 종료 시간
|
|
69
|
-
{ label: "09:30", value: 9.5 },
|
|
70
|
-
// 두 번째 쌍의 시작 시간
|
|
71
|
-
{ label: "10:00", value: 10 }
|
|
72
|
-
// 두 번째 쌍의 종료 시간
|
|
73
|
-
]);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import e from "./getVimeoId.mjs";
|
|
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);
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
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", {
|
|
9
|
-
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/537.36"
|
|
10
|
-
}), expect(e()).toBe(!1);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
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를 반환한다.", () => {
|
|
10
|
-
Object.defineProperty(window, "flutter_inappwebview", {
|
|
11
|
-
value: {
|
|
12
|
-
callHandler: () => {
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
configurable: !0
|
|
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);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1,10 +0,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);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
@@ -1,12 +0,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);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
"?a=1&b=true&c=test&d=undefined&e=null&f=%5Bobject+Object%5D"
|
|
7
|
-
);
|
|
8
|
-
}), t("변환할 수 없는 타입이 들어온 경우 빈 문자열을 반환한다.", () => {
|
|
9
|
-
expect(e(null)).toEqual(""), expect(e(void 0)).toEqual("");
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
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({
|
|
7
|
-
key1: "value1",
|
|
8
|
-
key2: "value2"
|
|
9
|
-
});
|
|
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" });
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
-
});
|