@getmicdrop/svelte-components 2.0.5 → 2.0.7

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.
Files changed (102) hide show
  1. package/dist/components/Alert/Alert.spec.js +170 -170
  2. package/dist/components/Badges/Badge.spec.js +103 -103
  3. package/dist/components/BottomSheet/BottomSheet.spec.js +127 -127
  4. package/dist/components/Breadcrumb/Breadcrumb.spec.js +120 -120
  5. package/dist/components/Button/Button.spec.js +211 -211
  6. package/dist/components/Button/ButtonSaveDemo.spec.js +48 -48
  7. package/dist/components/Calendar/Calendar.spec.js +131 -131
  8. package/dist/components/Calendar/QuarterView.spec.js +394 -394
  9. package/dist/components/Card.spec.js +47 -47
  10. package/dist/components/CropImage/CropImage.spec.js +216 -216
  11. package/dist/components/DarkModeToggle.spec.js +357 -357
  12. package/dist/components/ErrorDisplay.spec.js +69 -69
  13. package/dist/components/FormActions.spec.js +88 -88
  14. package/dist/components/FormValidationSummary.spec.js +203 -203
  15. package/dist/components/Icons/Icon.spec.js +175 -175
  16. package/dist/components/Icons/MoreHori.spec.js +67 -67
  17. package/dist/components/Icons/WarningIcon.spec.js +30 -30
  18. package/dist/components/Input/Input.spec.js +573 -573
  19. package/dist/components/Input/MultiSelect.spec.js +257 -257
  20. package/dist/components/Input/OTPInput.spec.js +238 -238
  21. package/dist/components/Input/Select.spec.js +218 -218
  22. package/dist/components/Layout/BottomNav.spec.js +130 -130
  23. package/dist/components/Layout/Header.spec.js +203 -203
  24. package/dist/components/Modal/ConfirmationModal.spec.js +191 -191
  25. package/dist/components/Modal/Modal.spec.js +95 -95
  26. package/dist/components/Modal/ModalStateManager.spec.js +100 -100
  27. package/dist/components/PageLoader.spec.js +54 -54
  28. package/dist/components/PasswordStrengthIndicator/PasswordStrengthIndicator.spec.js +173 -173
  29. package/dist/components/PlaceAutocomplete/PlaceAutocomplete.spec.js +300 -300
  30. package/dist/components/Spinner/Spinner.spec.js +75 -75
  31. package/dist/components/StatusIndicator/StatusIndicator.spec.js +129 -129
  32. package/dist/components/Toggle.spec.js +158 -158
  33. package/dist/components/ValidationError.spec.js +79 -79
  34. package/dist/components/pages/performers/AvailabilityCalendarModal.spec.js +606 -606
  35. package/dist/components/pages/performers/ModalShowInfo.spec.js +124 -124
  36. package/dist/components/pages/performers/PageBackButton.spec.js +89 -89
  37. package/dist/components/pages/performers/SectionHeader.spec.js +75 -75
  38. package/dist/components/pages/performers/ShowDetails.spec.js +166 -166
  39. package/dist/components/pages/performers/ShowItemCard.spec.js +793 -793
  40. package/dist/components/pages/performers/ShowItemCard.svelte +1 -1
  41. package/dist/components/pages/performers/SwitchOption.spec.js +127 -127
  42. package/dist/components/pages/performers/VenueInfo.spec.js +167 -167
  43. package/dist/components/pages/performers/VenueItemCard.spec.js +763 -763
  44. package/dist/components/pages/profile/profile-form.spec.js +9 -9
  45. package/dist/components/pages/settings/tabs/CustomImageDropzone.svelte +3 -3
  46. package/dist/components/pages/shows/ShowList.spec.js +33 -33
  47. package/dist/components/pages/shows/TabContent.spec.js +90 -90
  48. package/dist/components/pages/shows/TabNavigation.spec.js +143 -143
  49. package/dist/config.js +5 -5
  50. package/dist/config.spec.js +29 -29
  51. package/dist/constants/formOptions.js +25 -25
  52. package/dist/constants/formOptions.spec.js +88 -88
  53. package/dist/index.js +111 -111
  54. package/dist/stores/auth.d.ts +9 -0
  55. package/dist/stores/auth.d.ts.map +1 -0
  56. package/dist/stores/auth.js +36 -0
  57. package/dist/stores/auth.spec.d.ts +2 -0
  58. package/dist/stores/auth.spec.d.ts.map +1 -0
  59. package/dist/stores/auth.spec.js +139 -0
  60. package/dist/stores/formDataStore.d.ts +17 -0
  61. package/dist/stores/formDataStore.d.ts.map +1 -0
  62. package/dist/stores/formDataStore.js +25 -0
  63. package/dist/stores/formDataStore.spec.d.ts +2 -0
  64. package/dist/stores/formDataStore.spec.d.ts.map +1 -0
  65. package/dist/stores/formDataStore.spec.js +257 -0
  66. package/dist/stores/formSave.d.ts +24 -0
  67. package/dist/stores/formSave.d.ts.map +1 -0
  68. package/dist/stores/formSave.js +132 -0
  69. package/dist/stores/formSave.spec.d.ts +2 -0
  70. package/dist/stores/formSave.spec.d.ts.map +1 -0
  71. package/dist/stores/formSave.spec.js +296 -0
  72. package/dist/stores/index.d.ts +1 -0
  73. package/dist/stores/index.d.ts.map +1 -0
  74. package/dist/stores/index.js +0 -0
  75. package/dist/stores/navigation.d.ts +5 -0
  76. package/dist/stores/navigation.d.ts.map +1 -0
  77. package/dist/stores/navigation.js +12 -0
  78. package/dist/stores/navigation.spec.d.ts +2 -0
  79. package/dist/stores/navigation.spec.d.ts.map +1 -0
  80. package/dist/stores/navigation.spec.js +136 -0
  81. package/dist/stores/toaster.d.ts +4 -0
  82. package/dist/stores/toaster.d.ts.map +1 -0
  83. package/dist/stores/toaster.js +13 -0
  84. package/dist/stores/toaster.spec.d.ts +2 -0
  85. package/dist/stores/toaster.spec.d.ts.map +1 -0
  86. package/dist/stores/toaster.spec.js +59 -0
  87. package/dist/telemetry.js +357 -357
  88. package/dist/telemetry.server.js +211 -211
  89. package/dist/telemetry.server.spec.js +434 -434
  90. package/dist/telemetry.spec.js +660 -660
  91. package/dist/utils/apiConfig.js +49 -49
  92. package/dist/utils/apiConfig.spec.js +118 -118
  93. package/dist/utils/greetings.js +187 -187
  94. package/dist/utils/greetings.spec.js +337 -337
  95. package/dist/utils/imageValidation.js +121 -121
  96. package/dist/utils/imageValidation.spec.js +220 -220
  97. package/dist/utils/portal.js +25 -25
  98. package/dist/utils/portal.spec.js +143 -143
  99. package/dist/utils/utils/utils.js +323 -323
  100. package/dist/utils/utils/utils.spec.js +698 -698
  101. package/dist/utils/utils.spec.js +643 -643
  102. package/package.json +1 -1
@@ -1,69 +1,69 @@
1
- import { render, screen } from "@testing-library/svelte";
2
- import { expect, describe, test } from "vitest";
3
- import ErrorDisplay from "./ErrorDisplay.svelte";
4
-
5
- describe("ErrorDisplay Component Tests", () => {
6
- test("Shows error message when error and show are true", () => {
7
- render(ErrorDisplay, { props: { error: "Invalid input", show: true } });
8
- expect(screen.getByText("Invalid input")).toBeInTheDocument();
9
- });
10
-
11
- test("Does not show when error is empty", () => {
12
- render(ErrorDisplay, { props: { error: "", show: true } });
13
- expect(screen.queryByText("Invalid input")).not.toBeInTheDocument();
14
- });
15
-
16
- test("Does not show when show is false", () => {
17
- render(ErrorDisplay, { props: { error: "Error message", show: false } });
18
- expect(screen.queryByText("Error message")).not.toBeInTheDocument();
19
- });
20
-
21
- test("Has error text color", () => {
22
- const { container } = render(ErrorDisplay, {
23
- props: { error: "Error", show: true },
24
- });
25
- const wrapper = container.firstChild;
26
- expect(wrapper).toHaveClass("text-accent-Danger");
27
- });
28
-
29
- test("Has shake class when shake is true", () => {
30
- const { container } = render(ErrorDisplay, {
31
- props: { error: "Error", show: true, shake: true },
32
- });
33
- const wrapper = container.firstChild;
34
- expect(wrapper).toHaveClass("error-shake");
35
- });
36
-
37
- test("Does not have shake class when shake is false", () => {
38
- const { container } = render(ErrorDisplay, {
39
- props: { error: "Error", show: true, shake: false },
40
- });
41
- const wrapper = container.firstChild;
42
- expect(wrapper).not.toHaveClass("error-shake");
43
- });
44
-
45
- test("Contains icon element", () => {
46
- const { container } = render(ErrorDisplay, {
47
- props: { error: "Error", show: true },
48
- });
49
- const svg = container.querySelector("svg");
50
- expect(svg).toBeInTheDocument();
51
- });
52
-
53
- test("Has flex layout", () => {
54
- const { container } = render(ErrorDisplay, {
55
- props: { error: "Error", show: true },
56
- });
57
- const wrapper = container.firstChild;
58
- expect(wrapper).toHaveClass("flex");
59
- expect(wrapper).toHaveClass("items-center");
60
- });
61
-
62
- test("Applies custom className", () => {
63
- const { container } = render(ErrorDisplay, {
64
- props: { error: "Error", show: true, className: "mt-2" },
65
- });
66
- const wrapper = container.firstChild;
67
- expect(wrapper).toHaveClass("mt-2");
68
- });
69
- });
1
+ import { render, screen } from "@testing-library/svelte";
2
+ import { expect, describe, test } from "vitest";
3
+ import ErrorDisplay from "./ErrorDisplay.svelte";
4
+
5
+ describe("ErrorDisplay Component Tests", () => {
6
+ test("Shows error message when error and show are true", () => {
7
+ render(ErrorDisplay, { props: { error: "Invalid input", show: true } });
8
+ expect(screen.getByText("Invalid input")).toBeInTheDocument();
9
+ });
10
+
11
+ test("Does not show when error is empty", () => {
12
+ render(ErrorDisplay, { props: { error: "", show: true } });
13
+ expect(screen.queryByText("Invalid input")).not.toBeInTheDocument();
14
+ });
15
+
16
+ test("Does not show when show is false", () => {
17
+ render(ErrorDisplay, { props: { error: "Error message", show: false } });
18
+ expect(screen.queryByText("Error message")).not.toBeInTheDocument();
19
+ });
20
+
21
+ test("Has error text color", () => {
22
+ const { container } = render(ErrorDisplay, {
23
+ props: { error: "Error", show: true },
24
+ });
25
+ const wrapper = container.firstChild;
26
+ expect(wrapper).toHaveClass("text-accent-Danger");
27
+ });
28
+
29
+ test("Has shake class when shake is true", () => {
30
+ const { container } = render(ErrorDisplay, {
31
+ props: { error: "Error", show: true, shake: true },
32
+ });
33
+ const wrapper = container.firstChild;
34
+ expect(wrapper).toHaveClass("error-shake");
35
+ });
36
+
37
+ test("Does not have shake class when shake is false", () => {
38
+ const { container } = render(ErrorDisplay, {
39
+ props: { error: "Error", show: true, shake: false },
40
+ });
41
+ const wrapper = container.firstChild;
42
+ expect(wrapper).not.toHaveClass("error-shake");
43
+ });
44
+
45
+ test("Contains icon element", () => {
46
+ const { container } = render(ErrorDisplay, {
47
+ props: { error: "Error", show: true },
48
+ });
49
+ const svg = container.querySelector("svg");
50
+ expect(svg).toBeInTheDocument();
51
+ });
52
+
53
+ test("Has flex layout", () => {
54
+ const { container } = render(ErrorDisplay, {
55
+ props: { error: "Error", show: true },
56
+ });
57
+ const wrapper = container.firstChild;
58
+ expect(wrapper).toHaveClass("flex");
59
+ expect(wrapper).toHaveClass("items-center");
60
+ });
61
+
62
+ test("Applies custom className", () => {
63
+ const { container } = render(ErrorDisplay, {
64
+ props: { error: "Error", show: true, className: "mt-2" },
65
+ });
66
+ const wrapper = container.firstChild;
67
+ expect(wrapper).toHaveClass("mt-2");
68
+ });
69
+ });
@@ -1,88 +1,88 @@
1
- import { render, screen, fireEvent } from "@testing-library/svelte";
2
- import userEvent from "@testing-library/user-event";
3
- import { expect, describe, test, vi } from "vitest";
4
- import FormActions from "./FormActions.svelte";
5
-
6
- function setupTest(args = {}) {
7
- const user = userEvent.setup();
8
- const { component, container } = render(FormActions, {
9
- props: {
10
- onCancel: vi.fn(),
11
- onSubmit: vi.fn(),
12
- ...args,
13
- },
14
- });
15
- return { user, component, container };
16
- }
17
-
18
- describe("FormActions Component Tests", () => {
19
- test("Renders submit and cancel buttons", () => {
20
- setupTest();
21
- expect(screen.getByText("Save")).toBeInTheDocument();
22
- expect(screen.getByText("Cancel")).toBeInTheDocument();
23
- });
24
-
25
- test("Uses custom button labels", () => {
26
- setupTest({ submitLabel: "Update", cancelLabel: "Discard" });
27
- expect(screen.getByText("Update")).toBeInTheDocument();
28
- expect(screen.getByText("Discard")).toBeInTheDocument();
29
- });
30
-
31
- test("Calls onSubmit when submit button clicked", async () => {
32
- const onSubmit = vi.fn();
33
- const { user } = setupTest({ onSubmit });
34
-
35
- await user.click(screen.getByText("Save"));
36
- expect(onSubmit).toHaveBeenCalledTimes(1);
37
- });
38
-
39
- test("Calls onCancel when cancel button clicked", async () => {
40
- const onCancel = vi.fn();
41
- const { user } = setupTest({ onCancel });
42
-
43
- await user.click(screen.getByText("Cancel"));
44
- expect(onCancel).toHaveBeenCalledTimes(1);
45
- });
46
-
47
- test("Submit button shows loading state", () => {
48
- setupTest({ isSubmitting: true });
49
- const submitBtn = screen.getByText("Save").closest("button, a");
50
- expect(submitBtn).toBeDisabled();
51
- });
52
-
53
- test("Submit button shows success state", () => {
54
- setupTest({ isSuccess: true });
55
- const submitBtn = screen.getByText("Save").closest("button, a");
56
- expect(submitBtn).toHaveClass("btn-success");
57
- });
58
-
59
- test("Submit button is disabled when disabled prop is true", () => {
60
- setupTest({ disabled: true });
61
- const submitBtn = screen.getByText("Save").closest("button, a");
62
- expect(submitBtn).toBeDisabled();
63
- });
64
-
65
- test("Hides cancel button when showCancel is false", () => {
66
- setupTest({ showCancel: false });
67
- expect(screen.queryByText("Cancel")).not.toBeInTheDocument();
68
- });
69
-
70
- test("Uses custom submit variant", () => {
71
- setupTest({ submitVariant: "red-solid" });
72
- const submitBtn = screen.getByText("Save").closest("button, a");
73
- expect(submitBtn).toHaveClass("btn-red-solid");
74
- });
75
-
76
- test("Uses custom cancel variant", () => {
77
- setupTest({ cancelVariant: "blue-outline" });
78
- const cancelBtn = screen.getByText("Cancel").closest("button, a");
79
- expect(cancelBtn).toHaveClass("btn-blue-outline");
80
- });
81
-
82
- test("Has responsive layout classes", () => {
83
- const { container } = setupTest();
84
- const wrapper = container.firstChild;
85
- expect(wrapper).toHaveClass("w-full");
86
- expect(wrapper).toHaveClass("flex");
87
- });
88
- });
1
+ import { render, screen, fireEvent } from "@testing-library/svelte";
2
+ import userEvent from "@testing-library/user-event";
3
+ import { expect, describe, test, vi } from "vitest";
4
+ import FormActions from "./FormActions.svelte";
5
+
6
+ function setupTest(args = {}) {
7
+ const user = userEvent.setup();
8
+ const { component, container } = render(FormActions, {
9
+ props: {
10
+ onCancel: vi.fn(),
11
+ onSubmit: vi.fn(),
12
+ ...args,
13
+ },
14
+ });
15
+ return { user, component, container };
16
+ }
17
+
18
+ describe("FormActions Component Tests", () => {
19
+ test("Renders submit and cancel buttons", () => {
20
+ setupTest();
21
+ expect(screen.getByText("Save")).toBeInTheDocument();
22
+ expect(screen.getByText("Cancel")).toBeInTheDocument();
23
+ });
24
+
25
+ test("Uses custom button labels", () => {
26
+ setupTest({ submitLabel: "Update", cancelLabel: "Discard" });
27
+ expect(screen.getByText("Update")).toBeInTheDocument();
28
+ expect(screen.getByText("Discard")).toBeInTheDocument();
29
+ });
30
+
31
+ test("Calls onSubmit when submit button clicked", async () => {
32
+ const onSubmit = vi.fn();
33
+ const { user } = setupTest({ onSubmit });
34
+
35
+ await user.click(screen.getByText("Save"));
36
+ expect(onSubmit).toHaveBeenCalledTimes(1);
37
+ });
38
+
39
+ test("Calls onCancel when cancel button clicked", async () => {
40
+ const onCancel = vi.fn();
41
+ const { user } = setupTest({ onCancel });
42
+
43
+ await user.click(screen.getByText("Cancel"));
44
+ expect(onCancel).toHaveBeenCalledTimes(1);
45
+ });
46
+
47
+ test("Submit button shows loading state", () => {
48
+ setupTest({ isSubmitting: true });
49
+ const submitBtn = screen.getByText("Save").closest("button, a");
50
+ expect(submitBtn).toBeDisabled();
51
+ });
52
+
53
+ test("Submit button shows success state", () => {
54
+ setupTest({ isSuccess: true });
55
+ const submitBtn = screen.getByText("Save").closest("button, a");
56
+ expect(submitBtn).toHaveClass("btn-success");
57
+ });
58
+
59
+ test("Submit button is disabled when disabled prop is true", () => {
60
+ setupTest({ disabled: true });
61
+ const submitBtn = screen.getByText("Save").closest("button, a");
62
+ expect(submitBtn).toBeDisabled();
63
+ });
64
+
65
+ test("Hides cancel button when showCancel is false", () => {
66
+ setupTest({ showCancel: false });
67
+ expect(screen.queryByText("Cancel")).not.toBeInTheDocument();
68
+ });
69
+
70
+ test("Uses custom submit variant", () => {
71
+ setupTest({ submitVariant: "red-solid" });
72
+ const submitBtn = screen.getByText("Save").closest("button, a");
73
+ expect(submitBtn).toHaveClass("btn-red-solid");
74
+ });
75
+
76
+ test("Uses custom cancel variant", () => {
77
+ setupTest({ cancelVariant: "blue-outline" });
78
+ const cancelBtn = screen.getByText("Cancel").closest("button, a");
79
+ expect(cancelBtn).toHaveClass("btn-blue-outline");
80
+ });
81
+
82
+ test("Has responsive layout classes", () => {
83
+ const { container } = setupTest();
84
+ const wrapper = container.firstChild;
85
+ expect(wrapper).toHaveClass("w-full");
86
+ expect(wrapper).toHaveClass("flex");
87
+ });
88
+ });