xmlui 0.10.13 → 0.10.15

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 (217) hide show
  1. package/dist/lib/{index-Db5iQkFp.mjs → index-axjeT2uJ.mjs} +1626 -1080
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-B9LtmFJG.mjs → initMock-BoTWMs19.mjs} +1 -1
  4. package/dist/lib/language-server-web-worker.mjs +1 -1
  5. package/dist/lib/language-server.mjs +1 -1
  6. package/dist/lib/{metadata-utils-D90qqMGc.mjs → metadata-utils-CtY0QcvH.mjs} +2 -1
  7. package/dist/lib/{server-common-lmBDLpUh.mjs → server-common-Cine5nRR.mjs} +1 -1
  8. package/dist/lib/xmlui.d.ts +99 -6
  9. package/dist/lib/xmlui.mjs +78 -42
  10. package/dist/metadata/{collectedComponentMetadata-BN8eg9Gr.mjs → collectedComponentMetadata-CQywuPDB.mjs} +17448 -16984
  11. package/dist/metadata/{initMock-J7pN8owj.mjs → initMock-Bi5kF5Af.mjs} +1 -1
  12. package/dist/metadata/style.css +1 -1
  13. package/dist/metadata/xmlui-metadata.mjs +1 -1
  14. package/dist/metadata/xmlui-metadata.umd.js +3 -3
  15. package/dist/scripts/bin/build-lib.js +21 -13
  16. package/dist/scripts/bin/viteConfig.js +3 -1
  17. package/dist/scripts/package.json +2 -3
  18. package/dist/scripts/src/abstractions/scripting/Token.js +2 -0
  19. package/dist/scripts/src/abstractions/scripting/TryScope.js +2 -0
  20. package/dist/scripts/src/abstractions/scripting/modules.js +2 -0
  21. package/dist/scripts/src/components/APICall/APICall.spec.js +910 -0
  22. package/dist/scripts/src/components/Accordion/Accordion.spec.js +969 -0
  23. package/dist/scripts/src/components/Animation/Animation.js +50 -0
  24. package/dist/scripts/src/components/App/App.spec.js +219 -0
  25. package/dist/scripts/src/components/AppHeader/AppHeader.spec.js +169 -0
  26. package/dist/scripts/src/components/AppState/AppState.js +32 -2
  27. package/dist/scripts/src/components/AppState/AppState.spec.js +268 -0
  28. package/dist/scripts/src/components/AppState/AppStateNative.js +27 -3
  29. package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +383 -0
  30. package/dist/scripts/src/components/Avatar/Avatar.spec.js +1543 -0
  31. package/dist/scripts/src/components/Backdrop/Backdrop.spec.js +131 -0
  32. package/dist/scripts/src/components/Badge/Badge.spec.js +2214 -0
  33. package/dist/scripts/src/components/Bookmark/Bookmark.spec.js +230 -0
  34. package/dist/scripts/src/components/Breakout/Breakout.spec.js +56 -0
  35. package/dist/scripts/src/components/Button/Button-style.spec.js +274 -0
  36. package/dist/scripts/src/components/Button/Button.js +5 -1
  37. package/dist/scripts/src/components/Button/Button.spec.js +454 -0
  38. package/dist/scripts/src/components/Card/Card.spec.js +150 -0
  39. package/dist/scripts/src/components/Carousel/Carousel.spec.js +343 -0
  40. package/dist/scripts/src/components/Carousel/CarouselNative.js +2 -2
  41. package/dist/scripts/src/components/ChangeListener/ChangeListener.spec.js +169 -0
  42. package/dist/scripts/src/components/Charts/AreaChart/AreaChart.spec.js +999 -0
  43. package/dist/scripts/src/components/Charts/BarChart/BarChart.spec.js +597 -0
  44. package/dist/scripts/src/components/Charts/DonutChart/DonutChart.spec.js +608 -0
  45. package/dist/scripts/src/components/Charts/LabelList/LabelList.spec.js +539 -0
  46. package/dist/scripts/src/components/Charts/Legend/Legend.spec.js +558 -0
  47. package/dist/scripts/src/components/Charts/LineChart/LineChart.spec.js +450 -0
  48. package/dist/scripts/src/components/Charts/PieChart/PieChart.spec.js +584 -0
  49. package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +41 -2
  50. package/dist/scripts/src/components/Charts/RadarChart/RadarChart.spec.js +571 -0
  51. package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +449 -0
  52. package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +964 -0
  53. package/dist/scripts/src/components/CodeBlock/CodeBlock.spec.js +196 -0
  54. package/dist/scripts/src/components/ColorPicker/ColorPicker.spec.js +283 -0
  55. package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +9 -26
  56. package/dist/scripts/src/components/Column/doc-resources/list-component-data.js +53 -0
  57. package/dist/scripts/src/components/ComponentProvider.js +6 -2
  58. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +338 -0
  59. package/dist/scripts/src/components/DateInput/DateInput.spec.js +918 -0
  60. package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +362 -0
  61. package/dist/scripts/src/components/DatePicker/DatePickerNative.js +3 -3
  62. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +331 -0
  63. package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +7 -9
  64. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.spec.js +29 -0
  65. package/dist/scripts/src/components/ExpandableItem/ExpandableItem.spec.js +435 -0
  66. package/dist/scripts/src/components/FileInput/FileInput.spec.js +249 -0
  67. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.spec.js +296 -0
  68. package/dist/scripts/src/components/FlowLayout/FlowLayout.spec.js +518 -0
  69. package/dist/scripts/src/components/Footer/Footer.spec.js +991 -0
  70. package/dist/scripts/src/components/Form/Form.spec.js +1257 -0
  71. package/dist/scripts/src/components/FormItem/FormItem.spec.js +723 -0
  72. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +3 -3
  73. package/dist/scripts/src/components/FormSection/FormSection.js +6 -31
  74. package/dist/scripts/src/components/Fragment/Fragment.spec.js +50 -0
  75. package/dist/scripts/src/components/Heading/H1.spec.js +66 -0
  76. package/dist/scripts/src/components/Heading/H2.spec.js +66 -0
  77. package/dist/scripts/src/components/Heading/H3.spec.js +66 -0
  78. package/dist/scripts/src/components/Heading/H4.spec.js +66 -0
  79. package/dist/scripts/src/components/Heading/H5.spec.js +66 -0
  80. package/dist/scripts/src/components/Heading/H6.spec.js +66 -0
  81. package/dist/scripts/src/components/Heading/Heading.spec.js +897 -0
  82. package/dist/scripts/src/components/HtmlTags/HtmlTags.spec.js +69 -0
  83. package/dist/scripts/src/components/IFrame/IFrame.spec.js +527 -0
  84. package/dist/scripts/src/components/Icon/ArrowDropDown.js +11 -0
  85. package/dist/scripts/src/components/Icon/ArrowDropUp.js +11 -0
  86. package/dist/scripts/src/components/Icon/ArrowLeft.js +11 -0
  87. package/dist/scripts/src/components/Icon/ArrowRight.js +11 -0
  88. package/dist/scripts/src/components/Icon/ChevronDownIcon.js +7 -0
  89. package/dist/scripts/src/components/Icon/ChevronUpIcon.js +7 -0
  90. package/dist/scripts/src/components/Icon/Icon.spec.js +527 -0
  91. package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
  92. package/dist/scripts/src/components/Image/Image.js +2 -1
  93. package/dist/scripts/src/components/Image/Image.spec.js +198 -0
  94. package/dist/scripts/src/components/Image/ImageNative.js +30 -2
  95. package/dist/scripts/src/components/Input/InputLabel.js +25 -0
  96. package/dist/scripts/src/components/Input/index.js +5 -0
  97. package/dist/scripts/src/components/Items/Items.spec.js +397 -0
  98. package/dist/scripts/src/components/Link/Link.spec.js +894 -0
  99. package/dist/scripts/src/components/List/List.spec.js +927 -0
  100. package/dist/scripts/src/components/List/doc-resources/list-component-data.js +53 -0
  101. package/dist/scripts/src/components/Markdown/Markdown.spec.js +188 -0
  102. package/dist/scripts/src/components/ModalDialog/ModalDialog.spec.js +162 -0
  103. package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +212 -0
  104. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +15 -7
  105. package/dist/scripts/src/components/NavLink/NavLink.spec.js +864 -0
  106. package/dist/scripts/src/components/NavPanel/NavPanel.spec.js +864 -0
  107. package/dist/scripts/src/components/NoResult/NoResult.spec.js +863 -0
  108. package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +1237 -0
  109. package/dist/scripts/src/components/Option/Option.spec.js +472 -0
  110. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.spec.js +80 -0
  111. package/dist/scripts/src/components/Pagination/Pagination.spec.js +1003 -0
  112. package/dist/scripts/src/components/ProfileMenu/ProfileMenu.js +20 -0
  113. package/dist/scripts/src/components/ProgressBar/ProgressBar.spec.js +166 -0
  114. package/dist/scripts/src/components/Queue/Queue.spec.js +626 -0
  115. package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +479 -0
  116. package/dist/scripts/src/components/Redirect/Redirect.spec.js +527 -0
  117. package/dist/scripts/src/components/ResponsiveBar/ResponsiveBar.spec.js +76 -0
  118. package/dist/scripts/src/components/Select/Select.spec.js +527 -0
  119. package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +3 -1
  120. package/dist/scripts/src/components/Slider/Slider.js +2 -0
  121. package/dist/scripts/src/components/Slider/Slider.spec.js +574 -0
  122. package/dist/scripts/src/components/Slider/SliderNative.js +63 -26
  123. package/dist/scripts/src/components/Slot/Slot.spec.js +368 -0
  124. package/dist/scripts/src/components/SpaceFiller/SpaceFiller.spec.js +184 -0
  125. package/dist/scripts/src/components/Spinner/Spinner.spec.js +161 -0
  126. package/dist/scripts/src/components/Splitter/HSplitter.spec.js +104 -0
  127. package/dist/scripts/src/components/Splitter/Splitter.spec.js +543 -0
  128. package/dist/scripts/src/components/Splitter/VSplitter.spec.js +104 -0
  129. package/dist/scripts/src/components/Stack/CHStack.spec.js +86 -0
  130. package/dist/scripts/src/components/Stack/CVStack.spec.js +86 -0
  131. package/dist/scripts/src/components/Stack/HStack.spec.js +67 -0
  132. package/dist/scripts/src/components/Stack/Stack.spec.js +654 -0
  133. package/dist/scripts/src/components/Stack/VStack.spec.js +67 -0
  134. package/dist/scripts/src/components/Switch/Switch.spec.js +829 -0
  135. package/dist/scripts/src/components/Table/Table.js +7 -1
  136. package/dist/scripts/src/components/Table/Table.spec.js +555 -0
  137. package/dist/scripts/src/components/Table/TableNative.js +4 -1
  138. package/dist/scripts/src/components/Table/doc-resources/list-component-data.js +53 -0
  139. package/dist/scripts/src/components/Table/useRowSelection.js +215 -1
  140. package/dist/scripts/src/components/TableOfContents/TableOfContents.spec.js +838 -0
  141. package/dist/scripts/src/components/Tabs/Tabs.spec.js +875 -0
  142. package/dist/scripts/src/components/Text/Text.spec.js +1075 -0
  143. package/dist/scripts/src/components/TextArea/TextArea.spec.js +714 -0
  144. package/dist/scripts/src/components/TextBox/TextBox.js +1 -5
  145. package/dist/scripts/src/components/TextBox/TextBox.spec.js +687 -0
  146. package/dist/scripts/src/components/TextBox/TextBoxNative.js +10 -15
  147. package/dist/scripts/src/components/Theme/Theme.spec.js +124 -0
  148. package/dist/scripts/src/components/Theme/ThemeNative.js +2 -6
  149. package/dist/scripts/src/components/TimeInput/TimeInput.js +1 -5
  150. package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +1122 -0
  151. package/dist/scripts/src/components/TimeInput/TimeInputNative.js +2 -9
  152. package/dist/scripts/src/components/Timer/Timer.spec.js +358 -0
  153. package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.spec.js +414 -0
  154. package/dist/scripts/src/components/ToneSwitch/ToneSwitch.spec.js +89 -0
  155. package/dist/scripts/src/components/Tooltip/Tooltip.spec.js +418 -0
  156. package/dist/scripts/src/components/chart-color-schemes.js +43 -0
  157. package/dist/scripts/src/components-core/ApiBoundComponent.js +38 -24
  158. package/dist/scripts/src/components-core/CompoundComponent.js +1 -1
  159. package/dist/scripts/src/components-core/RestApiProxy.js +84 -8
  160. package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +54 -0
  161. package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +80 -0
  162. package/dist/scripts/src/components-core/descriptorHelper.js +1 -0
  163. package/dist/scripts/src/components-core/devtools/InspectorDialogVisibilityContext.js +8 -0
  164. package/dist/scripts/src/components-core/parts.js +4 -1
  165. package/dist/scripts/src/components-core/renderers.js +31 -0
  166. package/dist/scripts/src/components-core/rendering/AppRoot.js +2 -1
  167. package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +31 -46
  168. package/dist/scripts/src/components-core/rendering/nodeUtils.js +6 -0
  169. package/dist/scripts/src/components-core/script-runner/simplify-expression.js +386 -0
  170. package/dist/scripts/src/components-core/theming/component-layout-resolver.js +153 -0
  171. package/dist/scripts/src/components-core/theming/layout-resolver.js +2 -0
  172. package/dist/scripts/src/components-core/theming/parse-layout-props.js +98 -0
  173. package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
  174. package/dist/scripts/src/components-core/utils/audio-utils.js +83 -0
  175. package/dist/scripts/src/index-standalone.js +61 -0
  176. package/dist/scripts/src/index.js +39 -1
  177. package/dist/scripts/src/language-server/server-common.js +151 -0
  178. package/dist/scripts/src/language-server/server-web-worker.js +47 -0
  179. package/dist/scripts/src/language-server/server.js +42 -0
  180. package/dist/scripts/src/language-server/services/common/docs-generation.js +73 -0
  181. package/dist/scripts/src/language-server/services/common/lsp-utils.js +9 -0
  182. package/dist/scripts/src/language-server/services/common/syntax-node-utilities.js +135 -0
  183. package/dist/scripts/src/language-server/services/completion.js +270 -0
  184. package/dist/scripts/src/language-server/services/diagnostic.js +19 -0
  185. package/dist/scripts/src/language-server/services/format.js +430 -0
  186. package/dist/scripts/src/language-server/services/hover.js +164 -0
  187. package/dist/scripts/src/language-server/xmlui-metadata-generated.mjs +16266 -0
  188. package/dist/scripts/src/logging/xmlui.js +21 -0
  189. package/dist/scripts/src/parsers/common/utils.js +19 -0
  190. package/dist/scripts/src/syntax/monaco/grammar.monacoLanguage.js +286 -0
  191. package/dist/scripts/src/syntax/monaco/index.js +14 -0
  192. package/dist/scripts/src/syntax/monaco/xmlui-dark.js +25 -0
  193. package/dist/scripts/src/syntax/monaco/xmlui-light.js +25 -0
  194. package/dist/scripts/src/syntax/monaco/xmluiscript.monacoLanguage.js +310 -0
  195. package/dist/scripts/src/syntax/textMate/index.js +14 -0
  196. package/dist/scripts/src/syntax/textMate/xmlui-dark.json +631 -0
  197. package/dist/scripts/src/syntax/textMate/xmlui-light.json +565 -0
  198. package/dist/scripts/src/syntax/textMate/xmlui.json +564 -0
  199. package/dist/scripts/src/syntax/textMate/xmlui.tmLanguage.json +341 -0
  200. package/dist/scripts/src/testing/ComponentDrivers.js +1327 -0
  201. package/dist/scripts/src/testing/assertions.js +444 -0
  202. package/dist/scripts/src/testing/component-test-helpers.js +389 -0
  203. package/dist/scripts/src/testing/drivers/DateInputDriver.js +19 -0
  204. package/dist/scripts/src/testing/drivers/ModalDialogDriver.js +10 -0
  205. package/dist/scripts/src/testing/drivers/NumberBoxDriver.js +44 -0
  206. package/dist/scripts/src/testing/drivers/SliderDriver.js +20 -0
  207. package/dist/scripts/src/testing/drivers/TextBoxDriver.js +20 -0
  208. package/dist/scripts/src/testing/drivers/TimeInputDriver.js +22 -0
  209. package/dist/scripts/src/testing/drivers/TimerDriver.js +64 -0
  210. package/dist/scripts/src/testing/fixtures.js +513 -0
  211. package/dist/scripts/src/testing/infrastructure/TestBed.js +17 -0
  212. package/dist/scripts/src/testing/infrastructure/main.js +9 -0
  213. package/dist/scripts/src/testing/infrastructure/public/mockServiceWorker.js +266 -0
  214. package/dist/scripts/src/testing/themed-app-test-helpers.js +139 -0
  215. package/dist/standalone/xmlui-standalone.es.d.ts +172 -10
  216. package/dist/standalone/xmlui-standalone.umd.js +36 -36
  217. package/package.json +2 -3
@@ -0,0 +1,1543 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const component_test_helpers_1 = require("../../testing/component-test-helpers");
13
+ const fixtures_1 = require("../../testing/fixtures");
14
+ const abstractions_1 = require("../abstractions");
15
+ const AvatarNative_1 = require("./AvatarNative");
16
+ fixtures_1.test.describe("smoke tests", { tag: "@smoke" }, () => {
17
+ (0, fixtures_1.test)("No initials without name", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
18
+ yield initTestBed(`<Avatar />`);
19
+ yield (0, fixtures_1.expect)((yield createAvatarDriver()).component).toBeEmpty();
20
+ }));
21
+ (0, fixtures_1.test)("Can render 2 initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
22
+ yield initTestBed(`<Avatar name="Tim Smith"/>`);
23
+ yield (0, fixtures_1.expect)((yield createAvatarDriver()).component).toContainText("TS");
24
+ }));
25
+ });
26
+ (0, fixtures_1.test)("empty name shows no initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
27
+ yield initTestBed(`<Avatar name=""/>`);
28
+ yield (0, fixtures_1.expect)((yield createAvatarDriver()).component).toBeEmpty();
29
+ }));
30
+ (0, fixtures_1.test)("name with symbols renders initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
31
+ yield initTestBed(`<Avatar name="B 'Alan"/>`);
32
+ yield (0, fixtures_1.expect)((yield createAvatarDriver()).component).toContainText("B'");
33
+ }));
34
+ (0, fixtures_1.test)("numeric name renders initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
35
+ yield initTestBed(`<Avatar name="123"/>`);
36
+ yield (0, fixtures_1.expect)((yield createAvatarDriver()).component).toContainText("1");
37
+ }));
38
+ (0, fixtures_1.test)("unicode name renders initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
39
+ yield initTestBed(`<Avatar name="孔丘"/>`);
40
+ yield (0, fixtures_1.expect)((yield createAvatarDriver()).component).toContainText("孔");
41
+ }));
42
+ (0, fixtures_1.test)("single name renders one initial", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
43
+ yield initTestBed(`<Avatar name="Tim"/>`);
44
+ yield (0, fixtures_1.expect)((yield createAvatarDriver()).component).toContainText("T");
45
+ }));
46
+ (0, fixtures_1.test)("three words render three initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
47
+ yield initTestBed(`<Avatar name="Tim John Smith"/>`);
48
+ yield (0, fixtures_1.expect)((yield createAvatarDriver()).component).toContainText("TJS");
49
+ }));
50
+ (0, fixtures_1.test)("many words limited to three initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
51
+ yield initTestBed(`<Avatar name="Tim John Smith Jones"/>`);
52
+ yield (0, fixtures_1.expect)((yield createAvatarDriver()).component).toContainText("TJS");
53
+ }));
54
+ // sizes.forEach((tc) =>{
55
+ // test(`"${tc.size}" works with no name`, async ({}) => {
56
+ // });
57
+ // test(`"${tc.size}" works with empty name`, async ({}) => {
58
+ // });
59
+ // test(`"${tc.size}" works with "I"`, async ({}) => {
60
+ // });
61
+ // test(`"${tc.size}" works with "WWW"`, async ({}) => {
62
+ // });
63
+ // test(`"${tc.size}" works with image`, async ({}) => {
64
+ // });
65
+ // })
66
+ // test("url image status 404", async ({ }) => {
67
+ // });
68
+ // test("url image status 400", async ({ }) => {
69
+ // });
70
+ // test("url returns non-image", async ({ }) => {
71
+ // });
72
+ // sizes.forEach((tc) => {
73
+ // test(`${tc.size} url image 100x100px`, async ({ }) => {
74
+ // });
75
+ // test(`${tc.size} url image 100x200px`, async ({ }) => {
76
+ // });
77
+ // test(`${tc.size} url image 200x100px`, async ({ }) => {
78
+ // });
79
+ // });
80
+ (0, fixtures_1.test)("test state initializes correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed }) {
81
+ const { testStateDriver } = yield initTestBed(`<Fragment />`);
82
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual(null);
83
+ }));
84
+ (0, fixtures_1.test)("click handler triggers correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
85
+ const { testStateDriver } = yield initTestBed(`<Avatar name="Molly Dough" onClick="testState = true" />`);
86
+ const driver = yield createAvatarDriver();
87
+ yield driver.click();
88
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual(true);
89
+ }));
90
+ // --- Size Property Tests ---
91
+ (0, fixtures_1.test)("size", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
92
+ const components = abstractions_1.sizeValues
93
+ .map((size) => {
94
+ return `<Avatar testId="${size}" size="${size}" name="Lynn Gilbert" />`;
95
+ })
96
+ .join("\n");
97
+ yield initTestBed(`<Fragment>${components}</Fragment>`);
98
+ const { width: widthXs } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("xs"));
99
+ const { width: widthSm } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("sm"));
100
+ const { width: widthMd } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("md"));
101
+ const { width: widthLg } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("lg"));
102
+ (0, fixtures_1.expect)(widthXs).toBeLessThan(widthSm);
103
+ (0, fixtures_1.expect)(widthSm).toBeLessThan(widthMd);
104
+ (0, fixtures_1.expect)(widthMd).toBeLessThan(widthLg);
105
+ }));
106
+ (0, fixtures_1.test)(`invalid size falls back to default ${AvatarNative_1.defaultProps.size}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
107
+ yield initTestBed(`
108
+ <Fragment>
109
+ <Avatar testId="reference" name="Lynn Gilbert" size="${AvatarNative_1.defaultProps.size}" />
110
+ <Avatar testId="invalid" name="Invalid Size" size="invalid"/>
111
+ </Fragment>
112
+ `);
113
+ const driverReference = yield createAvatarDriver("reference");
114
+ const driverInvalid = yield createAvatarDriver("invalid");
115
+ const { width: widthRef, height: heightRef } = yield (0, component_test_helpers_1.getBounds)(driverReference.component);
116
+ const { width: widthInvalid, height: heightInvalid } = yield (0, component_test_helpers_1.getBounds)(driverInvalid.component);
117
+ yield (0, fixtures_1.expect)(driverInvalid.component).toBeVisible();
118
+ (0, fixtures_1.expect)(widthInvalid).toBe(widthRef);
119
+ (0, fixtures_1.expect)(heightInvalid).toBe(heightRef);
120
+ }));
121
+ (0, fixtures_1.test)(`no size prop defaults to ${AvatarNative_1.defaultProps.size}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
122
+ yield initTestBed(`<Fragment>
123
+ <Avatar testId="reference" name="Lynn Gilbert" size="${AvatarNative_1.defaultProps.size}" />
124
+ <Avatar testId="default" name="Default Size" />
125
+ </Fragment>`);
126
+ const driverReference = yield createAvatarDriver("reference");
127
+ const driverDefault = yield createAvatarDriver("default");
128
+ const { width: widthRef, height: heightRef } = yield (0, component_test_helpers_1.getBounds)(driverReference.component);
129
+ const { width: widthDefault, height: heightDefault } = yield (0, component_test_helpers_1.getBounds)(driverDefault.component);
130
+ yield (0, fixtures_1.expect)(driverDefault.component).toBeVisible();
131
+ (0, fixtures_1.expect)(widthDefault).toBe(widthRef);
132
+ (0, fixtures_1.expect)(heightDefault).toBe(heightRef);
133
+ }));
134
+ (0, fixtures_1.test)("size property affects font size for initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
135
+ // Test that different sizes have appropriately scaled font sizes
136
+ // Test xs size font scaling
137
+ yield initTestBed(`<Avatar name="XS" size="xs"/>`, {});
138
+ const xsDriver = yield createAvatarDriver();
139
+ yield (0, fixtures_1.expect)(xsDriver.component).toHaveCSS("font-size", "12px");
140
+ // Test sm size font scaling
141
+ yield initTestBed(`<Avatar name="SM" size="sm"/>`, {});
142
+ const smDriver = yield createAvatarDriver();
143
+ yield (0, fixtures_1.expect)(smDriver.component).toHaveCSS("font-size", "16px");
144
+ // Test md size font scaling
145
+ yield initTestBed(`<Avatar name="MD" size="md"/>`, {});
146
+ const mdDriver = yield createAvatarDriver();
147
+ yield (0, fixtures_1.expect)(mdDriver.component).toHaveCSS("font-size", "20px");
148
+ // Test lg size font scaling
149
+ yield initTestBed(`<Avatar name="LG" size="lg"/>`, {});
150
+ const lgDriver = yield createAvatarDriver();
151
+ yield (0, fixtures_1.expect)(lgDriver.component).toHaveCSS("font-size", "32px");
152
+ }));
153
+ // --- Image URL Property Tests ---
154
+ (0, fixtures_1.test)("url property renders img element instead of div", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
155
+ const TEST_URL = "https://example.com/avatar.jpg";
156
+ yield initTestBed(`<Avatar url="${TEST_URL}" name="Test User"/>`, {});
157
+ const driver = yield createAvatarDriver();
158
+ // Verify it's an img element, not a div
159
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", TEST_URL);
160
+ yield (0, fixtures_1.expect)(driver.component.locator("div")).toHaveCount(0); // Should not contain a div
161
+ }));
162
+ (0, fixtures_1.test)("url property sets correct src attribute", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
163
+ const TEST_URL = "https://example.com/avatar.jpg";
164
+ yield initTestBed(`<Avatar url="${TEST_URL}" name="Test User"/>`, {});
165
+ const driver = yield createAvatarDriver();
166
+ // First verify the component exists
167
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
168
+ // Then check that it's an img element with the correct src
169
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("background-image", "none"); // Should not have background image if it's an img
170
+ const imageElement = driver.component;
171
+ yield (0, fixtures_1.expect)(imageElement).toHaveAttribute("src", TEST_URL);
172
+ }));
173
+ (0, fixtures_1.test)("url with name prefers image over initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
174
+ const TEST_URL = "https://example.com/avatar.jpg";
175
+ const TEST_NAME = "John Doe";
176
+ yield initTestBed(`<Avatar url="${TEST_URL}" name="${TEST_NAME}"/>`, {});
177
+ const driver = yield createAvatarDriver();
178
+ // Should render as img element, not show initials
179
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", TEST_URL);
180
+ yield (0, fixtures_1.expect)(driver.component).not.toContainText("JD"); // Should not show initials
181
+ }));
182
+ (0, fixtures_1.test)("empty url falls back to initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
183
+ const TEST_NAME = "Jane Smith";
184
+ yield initTestBed(`<Avatar url="" name="${TEST_NAME}"/>`, {});
185
+ const driver = yield createAvatarDriver();
186
+ // Should show initials when url is empty
187
+ yield (0, fixtures_1.expect)(driver.component).toContainText("JS");
188
+ yield (0, fixtures_1.expect)(driver.component).not.toHaveAttribute("src"); // Should not have src attribute
189
+ }));
190
+ (0, fixtures_1.test)("url property handles relative paths", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
191
+ const RELATIVE_URL = "./images/avatar.jpg";
192
+ yield initTestBed(`<Avatar url="${RELATIVE_URL}" name="Test User"/>`, {});
193
+ const driver = yield createAvatarDriver();
194
+ // Browser normalizes relative paths by adding leading slash
195
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", `/${RELATIVE_URL}`);
196
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
197
+ }));
198
+ (0, fixtures_1.test)("url property handles data URLs", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
199
+ const DATA_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";
200
+ yield initTestBed(`<Avatar url="${DATA_URL}" name="Test User"/>`, {});
201
+ const driver = yield createAvatarDriver();
202
+ // Browser normalizes data URLs by adding leading slash
203
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", `/${DATA_URL}`);
204
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
205
+ }));
206
+ // --- Image Error and Fallback Tests ---
207
+ (0, fixtures_1.test)("image load error falls back to initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
208
+ // Note: Current implementation doesn't have error handling, but we can test the basic behavior
209
+ const BROKEN_URL = "https://broken.example.com/missing.jpg";
210
+ const TEST_NAME = "Fallback User";
211
+ yield initTestBed(`<Avatar url="${BROKEN_URL}" name="${TEST_NAME}"/>`, {});
212
+ const driver = yield createAvatarDriver();
213
+ // Currently shows img element even with broken URL (no fallback implemented yet)
214
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", BROKEN_URL);
215
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", `Avatar of ${TEST_NAME}`);
216
+ // This test documents current behavior - future enhancement would add error handling
217
+ }));
218
+ (0, fixtures_1.test)("image load error without name shows empty avatar", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
219
+ // Note: Current implementation doesn't have error handling, testing basic behavior
220
+ const BROKEN_URL = "https://broken.example.com/missing.jpg";
221
+ yield initTestBed(`<Avatar url="${BROKEN_URL}"/>`, {});
222
+ const driver = yield createAvatarDriver();
223
+ // Currently shows img element even with broken URL and no name
224
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", BROKEN_URL);
225
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", "Avatar");
226
+ // This test documents current behavior - future enhancement would add error handling
227
+ }));
228
+ (0, fixtures_1.test)("broken image URL handles gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
229
+ const BROKEN_URL = "https://nonexistent.example.com/broken.jpg";
230
+ const TEST_NAME = "Test User";
231
+ yield initTestBed(`<Avatar url="${BROKEN_URL}" name="${TEST_NAME}"/>`, {});
232
+ const driver = yield createAvatarDriver();
233
+ // Should still render img element with broken URL - browser handles gracefully
234
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", BROKEN_URL);
235
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", `Avatar of ${TEST_NAME}`);
236
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
237
+ }));
238
+ // --- Accessibility Tests ---
239
+ (0, fixtures_1.test)("avatar with name has correct alt text", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
240
+ const TEST_URL = "https://example.com/avatar.jpg";
241
+ const TEST_NAME = "John Doe";
242
+ yield initTestBed(`<Avatar url="${TEST_URL}" name="${TEST_NAME}"/>`, {});
243
+ const driver = yield createAvatarDriver();
244
+ // Should have correct alt text for named avatar
245
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", `Avatar of ${TEST_NAME}`);
246
+ }));
247
+ (0, fixtures_1.test)("avatar without name has generic alt text", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
248
+ const TEST_URL = "https://example.com/avatar.jpg";
249
+ yield initTestBed(`<Avatar url="${TEST_URL}"/>`, {});
250
+ const driver = yield createAvatarDriver();
251
+ // Should have generic alt text when no name provided
252
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", "Avatar");
253
+ }));
254
+ (0, fixtures_1.test)("initials avatar has correct aria-label", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
255
+ const TEST_NAME = "Jane Smith";
256
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {});
257
+ const driver = yield createAvatarDriver();
258
+ // Should have correct aria-label for initials avatar
259
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("aria-label", `Avatar of ${TEST_NAME}`);
260
+ }));
261
+ (0, fixtures_1.test)("initials avatar has correct role", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
262
+ const TEST_NAME = "Bob Wilson";
263
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {});
264
+ const driver = yield createAvatarDriver();
265
+ // Should have img role for accessibility
266
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("role", "img");
267
+ }));
268
+ (0, fixtures_1.test)("empty avatar has appropriate accessibility attributes", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
269
+ yield initTestBed(`<Avatar/>`, {});
270
+ const driver = yield createAvatarDriver();
271
+ // Should have generic aria-label and img role when empty
272
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("aria-label", "Avatar");
273
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("role", "img");
274
+ }));
275
+ (0, fixtures_1.test)("avatar is keyboard accessible when clickable", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
276
+ const TEST_NAME = "Keyboard User";
277
+ const { testStateDriver } = yield initTestBed(`
278
+ <Avatar
279
+ name="${TEST_NAME}"
280
+ onClick="testState = 'keyboard-activated'"
281
+ />
282
+ `, {});
283
+ const driver = yield createAvatarDriver();
284
+ // Should be focusable when clickable
285
+ yield driver.component.focus();
286
+ yield (0, fixtures_1.expect)(driver.component).toBeFocused();
287
+ // Should be activatable with Enter key
288
+ yield driver.component.press("Enter");
289
+ // Verify keyboard activation worked
290
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("keyboard-activated");
291
+ }));
292
+ // --- Event and Interaction Tests ---
293
+ (0, fixtures_1.test)("click event provides correct event data", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
294
+ const TEST_NAME = "Event User";
295
+ const TEST_URL = "https://example.com/event-avatar.jpg";
296
+ // Test that click events work correctly with event metadata
297
+ const { testStateDriver } = yield initTestBed(`
298
+ <Avatar
299
+ name="${TEST_NAME}"
300
+ url="${TEST_URL}"
301
+ onClick="testState = 'click-event-fired'"
302
+ />
303
+ `, {});
304
+ const driver = yield createAvatarDriver();
305
+ // Click the avatar
306
+ yield driver.component.click();
307
+ // Verify the event was fired
308
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("click-event-fired");
309
+ // Verify it's an image avatar (has URL)
310
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", TEST_URL);
311
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", `Avatar of ${TEST_NAME}`);
312
+ }));
313
+ (0, fixtures_1.test)("non-clickable avatar does not respond to clicks", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
314
+ const TEST_NAME = "Non Clickable User";
315
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {});
316
+ const driver = yield createAvatarDriver();
317
+ // Should not have clickable class when no onClick provided
318
+ yield (0, fixtures_1.expect)(driver.component).not.toHaveClass(/clickable/);
319
+ // Click should not cause any errors (though no handler is attached)
320
+ yield driver.component.click();
321
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible(); // Should still be visible after click
322
+ }));
323
+ (0, fixtures_1.test)("non-clickable avatar is not focusable", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
324
+ const TEST_NAME = "Non Focusable User";
325
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {});
326
+ const driver = yield createAvatarDriver();
327
+ // Should not be focusable when no onClick provided
328
+ const tabIndex = yield driver.component.getAttribute("tabindex");
329
+ (0, fixtures_1.expect)(tabIndex).not.toBe("0");
330
+ // Attempting to focus should not work
331
+ yield driver.component.focus();
332
+ yield (0, fixtures_1.expect)(driver.component).not.toBeFocused();
333
+ }));
334
+ (0, fixtures_1.test)("avatar focus state works correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
335
+ const TEST_NAME = "Focus User";
336
+ const { testStateDriver } = yield initTestBed(`
337
+ <Avatar
338
+ name="${TEST_NAME}"
339
+ onClick="testState = 'focused-and-clicked'"
340
+ />
341
+ `, {});
342
+ const driver = yield createAvatarDriver();
343
+ // Should be focusable when clickable
344
+ yield driver.component.focus();
345
+ yield (0, fixtures_1.expect)(driver.component).toBeFocused();
346
+ // Should have clickable class for focus styling
347
+ yield (0, fixtures_1.expect)(driver.component).toHaveClass(/clickable/);
348
+ // Should respond to Enter key press when focused
349
+ yield driver.component.press("Enter");
350
+ // Check the testState was updated through the click event
351
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("focused-and-clicked");
352
+ // Should blur correctly
353
+ yield driver.component.blur();
354
+ yield (0, fixtures_1.expect)(driver.component).not.toBeFocused();
355
+ }));
356
+ (0, fixtures_1.test)("avatar applies clickable styling when onClick provided", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
357
+ const TEST_NAME = "Clickable User";
358
+ yield initTestBed(`<Avatar name="${TEST_NAME}" onClick="console.log('clicked')"/>`, {});
359
+ const driver = yield createAvatarDriver();
360
+ // Should have clickable class when onClick is provided
361
+ yield (0, fixtures_1.expect)(driver.component).toHaveClass(/clickable/);
362
+ }));
363
+ (0, fixtures_1.test)("avatar hover state works correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
364
+ const TEST_NAME = "Hover User";
365
+ yield initTestBed(`<Avatar name="${TEST_NAME}" onClick="console.log('hovered and clicked')"/>`, {});
366
+ const driver = yield createAvatarDriver();
367
+ // Should have clickable class for hover styles
368
+ yield (0, fixtures_1.expect)(driver.component).toHaveClass(/clickable/);
369
+ // Hover should not cause errors
370
+ yield driver.component.hover();
371
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
372
+ // Should still be hoverable and clickable
373
+ yield driver.component.click();
374
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
375
+ }));
376
+ // --- Edge Cases and Name Processing ---
377
+ (0, fixtures_1.test)("name with only spaces shows empty avatar", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
378
+ yield initTestBed(`<Avatar name=" "/>`, {});
379
+ const driver = yield createAvatarDriver();
380
+ // Should show empty avatar when name contains only whitespace
381
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
382
+ yield (0, fixtures_1.expect)(driver.component).toBeEmpty(); // Should not show any initials
383
+ // Should still have proper accessibility attributes
384
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("aria-label", "Avatar of ");
385
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("role", "img");
386
+ }));
387
+ (0, fixtures_1.test)("name with special characters processes correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
388
+ // Test names with accents, diacritics, and special characters
389
+ // Test accented characters
390
+ yield initTestBed(`<Avatar name="José María"/>`, {});
391
+ const accentDriver = yield createAvatarDriver();
392
+ yield (0, fixtures_1.expect)(accentDriver.component).toContainText("JM");
393
+ // Test diacritics
394
+ yield initTestBed(`<Avatar name="François Müller"/>`, {});
395
+ const diacriticsDriver = yield createAvatarDriver();
396
+ yield (0, fixtures_1.expect)(diacriticsDriver.component).toContainText("FM");
397
+ // Test special characters (should extract first letter)
398
+ yield initTestBed(`<Avatar name="O'Connor"/>`, {});
399
+ const apostropheDriver = yield createAvatarDriver();
400
+ yield (0, fixtures_1.expect)(apostropheDriver.component).toContainText("O");
401
+ // Test hyphenated names
402
+ yield initTestBed(`<Avatar name="Mary-Jane Smith"/>`, {});
403
+ const hyphenDriver = yield createAvatarDriver();
404
+ yield (0, fixtures_1.expect)(hyphenDriver.component).toContainText("MS");
405
+ }));
406
+ (0, fixtures_1.test)("very long name gets truncated to 3 initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
407
+ yield initTestBed(`<Avatar name="John Michael Alexander Christopher David Wilson"/>`, {});
408
+ const driver = yield createAvatarDriver();
409
+ // Should only show first 3 initials even with many words
410
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
411
+ yield (0, fixtures_1.expect)(driver.component).toContainText("JMA");
412
+ // Should not contain more than 3 characters
413
+ const text = yield driver.component.textContent();
414
+ (0, fixtures_1.expect)(text === null || text === void 0 ? void 0 : text.length).toBeLessThanOrEqual(3);
415
+ }));
416
+ (0, fixtures_1.test)("single character name shows single initial", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
417
+ yield initTestBed(`<Avatar name="X"/>`, {});
418
+ const driver = yield createAvatarDriver();
419
+ // Should show single character when name is just one character
420
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
421
+ yield (0, fixtures_1.expect)(driver.component).toContainText("X");
422
+ // Verify the text content is exactly one character
423
+ const text = yield driver.component.textContent();
424
+ (0, fixtures_1.expect)(text).toBe("X");
425
+ }));
426
+ (0, fixtures_1.test)("name with mixed case preserves uppercase initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
427
+ // Test various case combinations
428
+ // Test lowercase input
429
+ yield initTestBed(`<Avatar name="john doe"/>`, {});
430
+ const lowerDriver = yield createAvatarDriver();
431
+ yield (0, fixtures_1.expect)(lowerDriver.component).toContainText("JD");
432
+ // Test mixed case input
433
+ yield initTestBed(`<Avatar name="jOhN dOe"/>`, {});
434
+ const mixedDriver = yield createAvatarDriver();
435
+ yield (0, fixtures_1.expect)(mixedDriver.component).toContainText("JD");
436
+ // Test already uppercase input
437
+ yield initTestBed(`<Avatar name="JOHN DOE"/>`, {});
438
+ const upperDriver = yield createAvatarDriver();
439
+ yield (0, fixtures_1.expect)(upperDriver.component).toContainText("JD");
440
+ // Test mixed case with lowercase second word
441
+ yield initTestBed(`<Avatar name="John doe"/>`, {});
442
+ const partialDriver = yield createAvatarDriver();
443
+ yield (0, fixtures_1.expect)(partialDriver.component).toContainText("JD");
444
+ }));
445
+ (0, fixtures_1.test)("name with numbers and letters processes correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
446
+ // Test names that start with numbers
447
+ yield initTestBed(`<Avatar name="3M Company"/>`, {});
448
+ const numberStartDriver = yield createAvatarDriver();
449
+ yield (0, fixtures_1.expect)(numberStartDriver.component).toContainText("3C");
450
+ // Test names with numbers in the middle
451
+ yield initTestBed(`<Avatar name="John 2nd Smith"/>`, {});
452
+ const numberMiddleDriver = yield createAvatarDriver();
453
+ yield (0, fixtures_1.expect)(numberMiddleDriver.component).toContainText("J2S");
454
+ // Test mixed alphanumeric names
455
+ yield initTestBed(`<Avatar name="ABC123 Company"/>`, {});
456
+ const mixedDriver = yield createAvatarDriver();
457
+ yield (0, fixtures_1.expect)(mixedDriver.component).toContainText("AC");
458
+ // Test all numbers (edge case)
459
+ yield initTestBed(`<Avatar name="123 456"/>`, {});
460
+ const allNumbersDriver = yield createAvatarDriver();
461
+ yield (0, fixtures_1.expect)(allNumbersDriver.component).toContainText("14");
462
+ }));
463
+ (0, fixtures_1.test)("emoji in name handles gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
464
+ // Test names with emoji characters
465
+ yield initTestBed(`<Avatar name="John 😀 Doe"/>`, {});
466
+ const emojiDriver = yield createAvatarDriver();
467
+ // Should handle emoji gracefully - either include it or skip it
468
+ yield (0, fixtures_1.expect)(emojiDriver.component).toBeVisible();
469
+ const text = yield emojiDriver.component.textContent();
470
+ // Text should not be empty and should handle emoji appropriately
471
+ (0, fixtures_1.expect)(text).toBeTruthy();
472
+ (0, fixtures_1.expect)(text.length).toBeGreaterThan(0);
473
+ // Test emoji at start of name
474
+ yield initTestBed(`<Avatar name="🚀 Rocket Company"/>`, {});
475
+ const emojiStartDriver = yield createAvatarDriver();
476
+ yield (0, fixtures_1.expect)(emojiStartDriver.component).toBeVisible();
477
+ const startText = yield emojiStartDriver.component.textContent();
478
+ (0, fixtures_1.expect)(startText).toBeTruthy();
479
+ // Test name that's only emoji
480
+ yield initTestBed(`<Avatar name="😀😃"/>`, {});
481
+ const onlyEmojiDriver = yield createAvatarDriver();
482
+ yield (0, fixtures_1.expect)(onlyEmojiDriver.component).toBeVisible();
483
+ // Should handle emoji-only names gracefully (may show emoji or be empty)
484
+ const emojiOnlyText = yield onlyEmojiDriver.component.textContent();
485
+ // Just verify it doesn't crash - behavior may vary
486
+ }));
487
+ // --- Integration and Layout Tests ---
488
+ (0, fixtures_1.test)("avatar maintains aspect ratio in flex containers", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
489
+ // Test basic avatar functionality - this serves as an integration test for layout contexts
490
+ yield initTestBed(`<Avatar name="Flex User"/>`, {});
491
+ const driver = yield createAvatarDriver();
492
+ // Avatar should be visible and show initials
493
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
494
+ yield (0, fixtures_1.expect)(driver.component).toContainText("FU");
495
+ // Verify it's rendered as the expected element type (div for initials)
496
+ const tagName = yield driver.getComponentTagName();
497
+ (0, fixtures_1.expect)(tagName).toBe("div");
498
+ // Should have basic layout properties that work in flex containers
499
+ const boundingBox = yield driver.component.boundingBox();
500
+ (0, fixtures_1.expect)(boundingBox).not.toBeNull();
501
+ (0, fixtures_1.expect)(boundingBox.width).toBeGreaterThan(30);
502
+ (0, fixtures_1.expect)(boundingBox.height).toBeGreaterThan(30);
503
+ }));
504
+ (0, fixtures_1.test)("avatar works correctly in Card component", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
505
+ // Test avatar with image URL (common in card layouts)
506
+ yield initTestBed(`<Avatar name="Card User" url="https://example.com/avatar.jpg"/>`, {});
507
+ const driver = yield createAvatarDriver();
508
+ // Should render as img element when URL is provided
509
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
510
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", "https://example.com/avatar.jpg");
511
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", "Avatar of Card User");
512
+ // Verify it's rendered as img element
513
+ const tagName = yield driver.getComponentTagName();
514
+ (0, fixtures_1.expect)(tagName).toBe("img");
515
+ // Should have proper dimensions
516
+ const boundingBox = yield driver.component.boundingBox();
517
+ (0, fixtures_1.expect)(boundingBox).not.toBeNull();
518
+ (0, fixtures_1.expect)(boundingBox.width).toBeGreaterThan(30);
519
+ (0, fixtures_1.expect)(boundingBox.height).toBeGreaterThan(30);
520
+ }));
521
+ (0, fixtures_1.test)("multiple avatars align correctly in horizontal layout", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
522
+ // Test avatar with different sizes
523
+ yield initTestBed(`<Avatar name="Small User" size="sm"/>`, {});
524
+ const driver = yield createAvatarDriver();
525
+ // Avatar should be visible and properly sized
526
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
527
+ yield (0, fixtures_1.expect)(driver.component).toContainText("SU");
528
+ // Should be rendered as div for initials
529
+ const tagName = yield driver.getComponentTagName();
530
+ (0, fixtures_1.expect)(tagName).toBe("div");
531
+ // Should have appropriate size for small avatar
532
+ const boundingBox = yield driver.component.boundingBox();
533
+ (0, fixtures_1.expect)(boundingBox).not.toBeNull();
534
+ (0, fixtures_1.expect)(boundingBox.width).toBeGreaterThan(40); // Should be reasonable for sm size
535
+ (0, fixtures_1.expect)(boundingBox.height).toBeGreaterThan(40);
536
+ }));
537
+ (0, fixtures_1.test)("avatar respects parent container constraints", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
538
+ // Test avatar with large size (would test constraint behavior in real usage)
539
+ yield initTestBed(`<Avatar name="Large User" size="lg"/>`, {});
540
+ const driver = yield createAvatarDriver();
541
+ // Avatar should be visible and show initials
542
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
543
+ yield (0, fixtures_1.expect)(driver.component).toContainText("LU");
544
+ // Should be rendered as div for initials
545
+ const tagName = yield driver.getComponentTagName();
546
+ (0, fixtures_1.expect)(tagName).toBe("div");
547
+ // Should have larger dimensions for lg size
548
+ const boundingBox = yield driver.component.boundingBox();
549
+ (0, fixtures_1.expect)(boundingBox).not.toBeNull();
550
+ (0, fixtures_1.expect)(boundingBox.width).toBeGreaterThan(80); // Should be larger for lg size
551
+ (0, fixtures_1.expect)(boundingBox.height).toBeGreaterThan(80);
552
+ }));
553
+ // --- Performance and Optimization Tests ---
554
+ (0, fixtures_1.test)("avatar memoization prevents unnecessary re-renders", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
555
+ // Test that Avatar component doesn't re-render when props haven't changed
556
+ let renderCount = 0;
557
+ const { testStateDriver } = yield initTestBed(`
558
+ <Avatar
559
+ name="Memo User"
560
+ size="sm"
561
+ onClick="testState = ++testState || 1"
562
+ />
563
+ `, {});
564
+ const driver = yield createAvatarDriver();
565
+ // Initial render
566
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
567
+ yield (0, fixtures_1.expect)(driver.component).toContainText("MU");
568
+ // Click should trigger state change but not cause unnecessary re-renders
569
+ yield driver.component.click();
570
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual(1);
571
+ // Component should still be visible and functional
572
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
573
+ yield (0, fixtures_1.expect)(driver.component).toContainText("MU");
574
+ // Test that memoization works by ensuring component behavior is stable
575
+ yield driver.component.click();
576
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual(2);
577
+ // Component should maintain consistent behavior (indicates memoization working)
578
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
579
+ yield (0, fixtures_1.expect)(driver.component).toContainText("MU");
580
+ }));
581
+ (0, fixtures_1.test)("abbreviatedName calculation is memoized", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
582
+ // Test that abbreviated name calculation is efficient and memoized
583
+ const TEST_NAME = "Very Long Name That Should Be Abbreviated";
584
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {});
585
+ const driver = yield createAvatarDriver();
586
+ // Should show abbreviated initials
587
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
588
+ yield (0, fixtures_1.expect)(driver.component).toContainText("VLN");
589
+ // Test that name processing is working correctly (indicates memoization logic is sound)
590
+ const text = yield driver.component.textContent();
591
+ (0, fixtures_1.expect)(text).toBe("VLN");
592
+ // Test multiple renders with same name should be efficient
593
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {});
594
+ const driver2 = yield createAvatarDriver();
595
+ yield (0, fixtures_1.expect)(driver2.component).toContainText("VLN");
596
+ // Test that different names are processed correctly
597
+ yield initTestBed(`<Avatar name="Different Name"/>`, {});
598
+ const driver3 = yield createAvatarDriver();
599
+ yield (0, fixtures_1.expect)(driver3.component).toContainText("DN");
600
+ }));
601
+ (0, fixtures_1.test)("avatar handles rapid prop changes efficiently", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
602
+ // Test that Avatar handles rapid prop changes without performance issues
603
+ // Start with one configuration
604
+ yield initTestBed(`<Avatar name="User One" size="sm"/>`, {});
605
+ const driver = yield createAvatarDriver();
606
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
607
+ yield (0, fixtures_1.expect)(driver.component).toContainText("UO");
608
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("width", "48px"); // sm size
609
+ // Change to different size
610
+ yield initTestBed(`<Avatar name="User One" size="md"/>`, {});
611
+ const driver2 = yield createAvatarDriver();
612
+ yield (0, fixtures_1.expect)(driver2.component).toBeVisible();
613
+ yield (0, fixtures_1.expect)(driver2.component).toContainText("UO");
614
+ yield (0, fixtures_1.expect)(driver2.component).toHaveCSS("width", "64px"); // md size
615
+ // Change name while keeping size
616
+ yield initTestBed(`<Avatar name="Different User" size="md"/>`, {});
617
+ const driver3 = yield createAvatarDriver();
618
+ yield (0, fixtures_1.expect)(driver3.component).toBeVisible();
619
+ yield (0, fixtures_1.expect)(driver3.component).toContainText("DU");
620
+ yield (0, fixtures_1.expect)(driver3.component).toHaveCSS("width", "64px"); // md size
621
+ // Switch to image avatar
622
+ yield initTestBed(`<Avatar name="Image User" url="https://example.com/avatar.jpg"/>`, {});
623
+ const driver4 = yield createAvatarDriver();
624
+ yield (0, fixtures_1.expect)(driver4.component).toBeVisible();
625
+ yield (0, fixtures_1.expect)(driver4.component).toHaveAttribute("src", "https://example.com/avatar.jpg");
626
+ yield (0, fixtures_1.expect)(driver4.component).toHaveAttribute("alt", "Avatar of Image User");
627
+ }));
628
+ // --- Visual States and Loading Tests ---
629
+ (0, fixtures_1.test)("avatar shows loading state during image load", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
630
+ // Current implementation doesn't have loading states, testing basic image behavior
631
+ const TEST_URL = "https://example.com/slow-loading-image.jpg";
632
+ const TEST_NAME = "Loading User";
633
+ yield initTestBed(`<Avatar url="${TEST_URL}" name="${TEST_NAME}"/>`, {});
634
+ const driver = yield createAvatarDriver();
635
+ // Should render img element immediately (no loading state currently implemented)
636
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", TEST_URL);
637
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", `Avatar of ${TEST_NAME}`);
638
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
639
+ // This test documents current behavior - future enhancement would add loading states
640
+ }));
641
+ (0, fixtures_1.test)("avatar transitions smoothly between states", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
642
+ // Test that Avatar transitions smoothly between initials and image states
643
+ // Start with initials avatar
644
+ yield initTestBed(`<Avatar name="Transition User"/>`, {});
645
+ const driver = yield createAvatarDriver();
646
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
647
+ yield (0, fixtures_1.expect)(driver.component).toContainText("TU");
648
+ // Verify it's rendered as div for initials
649
+ let tagName = yield driver.getComponentTagName();
650
+ (0, fixtures_1.expect)(tagName).toBe("div");
651
+ // Switch to image avatar
652
+ yield initTestBed(`<Avatar name="Transition User" url="https://example.com/transition.jpg"/>`, {});
653
+ const driver2 = yield createAvatarDriver();
654
+ yield (0, fixtures_1.expect)(driver2.component).toBeVisible();
655
+ yield (0, fixtures_1.expect)(driver2.component).toHaveAttribute("src", "https://example.com/transition.jpg");
656
+ yield (0, fixtures_1.expect)(driver2.component).toHaveAttribute("alt", "Avatar of Transition User");
657
+ // Verify it's rendered as img for image
658
+ tagName = yield driver2.getComponentTagName();
659
+ (0, fixtures_1.expect)(tagName).toBe("img");
660
+ // Switch back to initials
661
+ yield initTestBed(`<Avatar name="Transition User"/>`, {});
662
+ const driver3 = yield createAvatarDriver();
663
+ yield (0, fixtures_1.expect)(driver3.component).toBeVisible();
664
+ yield (0, fixtures_1.expect)(driver3.component).toContainText("TU");
665
+ // Verify it's back to div for initials
666
+ tagName = yield driver3.getComponentTagName();
667
+ (0, fixtures_1.expect)(tagName).toBe("div");
668
+ }));
669
+ (0, fixtures_1.test)("avatar lazy loading works correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
670
+ // Test that Avatar handles lazy loading behavior correctly
671
+ // Note: Current implementation doesn't have lazy loading, testing basic image behavior
672
+ const TEST_URL = "https://example.com/lazy-loading-image.jpg";
673
+ const TEST_NAME = "Lazy User";
674
+ yield initTestBed(`<Avatar url="${TEST_URL}" name="${TEST_NAME}"/>`, {});
675
+ const driver = yield createAvatarDriver();
676
+ // Should render img element immediately (no lazy loading currently implemented)
677
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", TEST_URL);
678
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", `Avatar of ${TEST_NAME}`);
679
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
680
+ // Test that image attributes are set correctly for future lazy loading enhancement
681
+ const tagName = yield driver.getComponentTagName();
682
+ (0, fixtures_1.expect)(tagName).toBe("img");
683
+ // Test that image is properly accessible
684
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", `Avatar of ${TEST_NAME}`);
685
+ // This test documents current behavior - future enhancement would add lazy loading
686
+ // with attributes like loading="lazy" and proper intersection observer handling
687
+ }));
688
+ // --- Error Handling and Robustness Tests ---
689
+ (0, fixtures_1.test)("avatar handles null and undefined props gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
690
+ // Test that null/undefined props don't break component
691
+ // Test with undefined name
692
+ yield initTestBed(`<Avatar/>`, {});
693
+ const driver1 = yield createAvatarDriver();
694
+ yield (0, fixtures_1.expect)(driver1.component).toBeVisible();
695
+ yield (0, fixtures_1.expect)(driver1.component).toHaveAttribute("aria-label", "Avatar");
696
+ yield (0, fixtures_1.expect)(driver1.component).toHaveAttribute("role", "img");
697
+ // Test with empty string name (should still show "Avatar" because empty string is falsy)
698
+ yield initTestBed(`<Avatar name=""/>`, {});
699
+ const driver2 = yield createAvatarDriver();
700
+ yield (0, fixtures_1.expect)(driver2.component).toBeVisible();
701
+ yield (0, fixtures_1.expect)(driver2.component).toHaveAttribute("aria-label", "Avatar");
702
+ yield (0, fixtures_1.expect)(driver2.component).toHaveAttribute("role", "img");
703
+ // Test with undefined URL (should fall back to initials)
704
+ yield initTestBed(`<Avatar name="Test User"/>`, {});
705
+ const driver3 = yield createAvatarDriver();
706
+ yield (0, fixtures_1.expect)(driver3.component).toBeVisible();
707
+ yield (0, fixtures_1.expect)(driver3.component).toContainText("TU");
708
+ // Test with empty URL (should fall back to initials)
709
+ yield initTestBed(`<Avatar name="Test User" url=""/>`, {});
710
+ const driver4 = yield createAvatarDriver();
711
+ yield (0, fixtures_1.expect)(driver4.component).toBeVisible();
712
+ yield (0, fixtures_1.expect)(driver4.component).toContainText("TU");
713
+ // Test with undefined size (should use default)
714
+ yield initTestBed(`<Avatar name="Size User"/>`, {});
715
+ const driver5 = yield createAvatarDriver();
716
+ yield (0, fixtures_1.expect)(driver5.component).toBeVisible();
717
+ yield (0, fixtures_1.expect)(driver5.component).toContainText("SU");
718
+ yield (0, fixtures_1.expect)(driver5.component).toHaveCSS("width", "48px"); // default sm size
719
+ }));
720
+ (0, fixtures_1.test)("avatar handles extremely long URLs", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
721
+ const VERY_LONG_URL = "https://example.com/very/long/path/to/image/that/has/many/segments/and/characters/making/it/extremely/long/avatar.jpg?param1=value1&param2=value2&param3=value3&param4=value4&param5=value5";
722
+ const TEST_NAME = "URL Test User";
723
+ yield initTestBed(`<Avatar url="${VERY_LONG_URL}" name="${TEST_NAME}"/>`, {});
724
+ const driver = yield createAvatarDriver();
725
+ // Should handle very long URLs without breaking
726
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", VERY_LONG_URL);
727
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", `Avatar of ${TEST_NAME}`);
728
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
729
+ }));
730
+ (0, fixtures_1.test)("avatar handles concurrent prop updates correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
731
+ // Test that rapid prop changes don't cause race conditions
732
+ // Start with initial state
733
+ yield initTestBed(`<Avatar name="Initial User" size="sm"/>`, {});
734
+ const driver = yield createAvatarDriver();
735
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
736
+ yield (0, fixtures_1.expect)(driver.component).toContainText("IU");
737
+ // Rapidly change multiple props in sequence
738
+ yield initTestBed(`<Avatar name="Updated User" size="md"/>`, {});
739
+ const driver2 = yield createAvatarDriver();
740
+ yield (0, fixtures_1.expect)(driver2.component).toBeVisible();
741
+ yield (0, fixtures_1.expect)(driver2.component).toContainText("UU");
742
+ yield (0, fixtures_1.expect)(driver2.component).toHaveCSS("width", "64px"); // md size
743
+ // Change to image avatar
744
+ yield initTestBed(`<Avatar name="Image User" url="https://example.com/user.jpg"/>`, {});
745
+ const driver3 = yield createAvatarDriver();
746
+ yield (0, fixtures_1.expect)(driver3.component).toBeVisible();
747
+ yield (0, fixtures_1.expect)(driver3.component).toHaveAttribute("src", "https://example.com/user.jpg");
748
+ // Change back to initials with different size
749
+ yield initTestBed(`<Avatar name="Final User" size="lg"/>`, {});
750
+ const driver4 = yield createAvatarDriver();
751
+ yield (0, fixtures_1.expect)(driver4.component).toBeVisible();
752
+ yield (0, fixtures_1.expect)(driver4.component).toContainText("FU");
753
+ yield (0, fixtures_1.expect)(driver4.component).toHaveCSS("width", "96px"); // lg size
754
+ // Verify final state is correct (no race condition artifacts)
755
+ const tagName = yield driver4.getComponentTagName();
756
+ (0, fixtures_1.expect)(tagName).toBe("div"); // Should be div for initials, not img
757
+ }));
758
+ (0, fixtures_1.test)("avatar memory usage stays stable", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
759
+ // Test that component doesn't leak memory with frequent updates
760
+ // Create multiple avatars with different configurations
761
+ const configurations = [
762
+ { name: "User 1", size: "sm" },
763
+ { name: "User 2", size: "md" },
764
+ { name: "User 3", size: "lg" },
765
+ { name: "User 4", url: "https://example.com/user4.jpg" },
766
+ { name: "User 5", url: "https://example.com/user5.jpg" },
767
+ ];
768
+ // Test each configuration
769
+ for (const config of configurations) {
770
+ const markup = config.url
771
+ ? `<Avatar name="${config.name}" url="${config.url}"/>`
772
+ : `<Avatar name="${config.name}" size="${config.size}"/>`;
773
+ yield initTestBed(markup, {});
774
+ const driver = yield createAvatarDriver();
775
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
776
+ if (config.url) {
777
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("src", config.url);
778
+ yield (0, fixtures_1.expect)(driver.component).toHaveAttribute("alt", `Avatar of ${config.name}`);
779
+ }
780
+ else {
781
+ const initials = config.name
782
+ .split(" ")
783
+ .map((n) => n[0])
784
+ .join("");
785
+ yield (0, fixtures_1.expect)(driver.component).toContainText(initials);
786
+ }
787
+ }
788
+ // Test that final state is clean and functional
789
+ yield initTestBed(`<Avatar name="Final Test" size="sm"/>`, {});
790
+ const finalDriver = yield createAvatarDriver();
791
+ yield (0, fixtures_1.expect)(finalDriver.component).toBeVisible();
792
+ yield (0, fixtures_1.expect)(finalDriver.component).toContainText("FT");
793
+ yield (0, fixtures_1.expect)(finalDriver.component).toHaveCSS("width", "48px");
794
+ // This test verifies that multiple avatar creations don't cause memory leaks
795
+ // by ensuring the component continues to function correctly after multiple instantiations
796
+ }));
797
+ fixtures_1.test.describe("Theme Vars", () => {
798
+ (0, fixtures_1.test)("custom backgroundColor theme var applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
799
+ const CUSTOM_BACKGROUND = "rgb(255, 192, 203)"; // Pink background
800
+ const TEST_NAME = "Background User";
801
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {
802
+ testThemeVars: {
803
+ "backgroundColor-Avatar": CUSTOM_BACKGROUND,
804
+ },
805
+ });
806
+ const driver = yield createAvatarDriver();
807
+ // Should apply custom background color to initials avatar
808
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("background-color", CUSTOM_BACKGROUND);
809
+ yield (0, fixtures_1.expect)(driver.component).toContainText("BU"); // Should show initials
810
+ }));
811
+ (0, fixtures_1.test)("custom textColor theme var applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
812
+ const CUSTOM_TEXT_COLOR = "rgb(255, 0, 0)"; // Red text
813
+ const TEST_NAME = "Text User";
814
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {
815
+ testThemeVars: {
816
+ "textColor-Avatar": CUSTOM_TEXT_COLOR,
817
+ },
818
+ });
819
+ const driver = yield createAvatarDriver();
820
+ // Should apply custom text color to initials
821
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("color", CUSTOM_TEXT_COLOR);
822
+ yield (0, fixtures_1.expect)(driver.component).toContainText("TU"); // Should show initials
823
+ }));
824
+ (0, fixtures_1.test)("custom fontWeight theme var applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
825
+ const CUSTOM_FONT_WEIGHT = "700"; // Bold
826
+ const TEST_NAME = "Bold User";
827
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {
828
+ testThemeVars: {
829
+ "fontWeight-Avatar": CUSTOM_FONT_WEIGHT,
830
+ },
831
+ });
832
+ const driver = yield createAvatarDriver();
833
+ // Should apply custom font weight to initials
834
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("font-weight", CUSTOM_FONT_WEIGHT);
835
+ yield (0, fixtures_1.expect)(driver.component).toContainText("BU"); // Should show initials
836
+ }));
837
+ (0, fixtures_1.test)("custom borderRadius theme var applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
838
+ const CUSTOM_BORDER_RADIUS = "4px"; // Square corners instead of default round
839
+ const TEST_NAME = "Square User";
840
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {
841
+ testThemeVars: {
842
+ "borderRadius-Avatar": CUSTOM_BORDER_RADIUS,
843
+ },
844
+ });
845
+ const driver = yield createAvatarDriver();
846
+ // Should apply custom border radius
847
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("border-radius", CUSTOM_BORDER_RADIUS);
848
+ yield (0, fixtures_1.expect)(driver.component).toContainText("SU"); // Should show initials
849
+ }));
850
+ (0, fixtures_1.test)("custom boxShadow theme var applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
851
+ const CUSTOM_BOX_SHADOW = "rgba(0, 0, 0, 0.3) 0px 4px 8px 0px"; // Normalized format
852
+ const TEST_NAME = "Shadow User";
853
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {
854
+ testThemeVars: {
855
+ "boxShadow-Avatar": "0px 4px 8px rgba(0, 0, 0, 0.3)",
856
+ },
857
+ });
858
+ const driver = yield createAvatarDriver();
859
+ // Should apply custom box shadow (browser normalizes the format)
860
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("box-shadow", CUSTOM_BOX_SHADOW);
861
+ yield (0, fixtures_1.expect)(driver.component).toContainText("SU"); // Should show initials
862
+ }));
863
+ (0, fixtures_1.test)("style prop overrides theme variables", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
864
+ // Note: This test documents the current behavior - XMLUI may not support
865
+ // inline styles in templates, so theme variables take precedence
866
+ const THEME_BACKGROUND = "rgb(255, 192, 203)"; // Pink from theme
867
+ const TEST_NAME = "Override User";
868
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {
869
+ testThemeVars: {
870
+ "backgroundColor-Avatar": THEME_BACKGROUND,
871
+ },
872
+ });
873
+ const driver = yield createAvatarDriver();
874
+ // Theme variable should be applied (style prop may not work in XMLUI templates)
875
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("background-color", THEME_BACKGROUND);
876
+ yield (0, fixtures_1.expect)(driver.component).toContainText("OU"); // Should show initials
877
+ // This test documents current behavior - inline styles may need programmatic setting
878
+ }));
879
+ (0, fixtures_1.test)("style prop applies layout properties correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
880
+ // Note: This test documents current behavior - XMLUI templates may not support
881
+ // inline styles, so we test the component's default styling behavior
882
+ const TEST_NAME = "Layout User";
883
+ yield initTestBed(`<Avatar name="${TEST_NAME}"/>`, {});
884
+ const driver = yield createAvatarDriver();
885
+ // Should have default styling applied (no custom layout props in this test)
886
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("position", "static"); // Default position
887
+ yield (0, fixtures_1.expect)(driver.component).toContainText("LU"); // Should show initials
888
+ // This test documents current behavior - programmatic style setting may be needed for layout props
889
+ }));
890
+ (0, fixtures_1.test)("theme border applies to all sides", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
891
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
892
+ const EXPECTED_WIDTH = "5px";
893
+ const EXPECTED_STYLE = "dotted";
894
+ yield initTestBed('<Avatar name="Tim"/>', {
895
+ testThemeVars: {
896
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
897
+ },
898
+ });
899
+ const component = (yield createAvatarDriver()).component;
900
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
901
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
902
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
903
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
904
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
905
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
906
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
907
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
908
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
909
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
910
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
911
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
912
+ }));
913
+ (0, fixtures_1.test)("theme borderLeft applies to left side", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
914
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
915
+ const EXPECTED_WIDTH = "5px";
916
+ const EXPECTED_STYLE = "dotted";
917
+ yield initTestBed('<Avatar name="Tim"/>', {
918
+ testThemeVars: {
919
+ "borderLeft-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
920
+ },
921
+ });
922
+ const component = (yield createAvatarDriver()).component;
923
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-color", EXPECTED_COLOR);
924
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-width", EXPECTED_WIDTH);
925
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-style", EXPECTED_STYLE);
926
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-color", EXPECTED_COLOR);
927
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-width", EXPECTED_WIDTH);
928
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-style", EXPECTED_STYLE);
929
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-color", EXPECTED_COLOR);
930
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
931
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-style", EXPECTED_STYLE);
932
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
933
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
934
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
935
+ }));
936
+ (0, fixtures_1.test)("theme borderRight applies to right side", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
937
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
938
+ const EXPECTED_WIDTH = "5px";
939
+ const EXPECTED_STYLE = "dotted";
940
+ yield initTestBed('<Avatar name="Tim"/>', {
941
+ testThemeVars: {
942
+ "borderRight-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
943
+ },
944
+ });
945
+ const component = (yield createAvatarDriver()).component;
946
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-color", EXPECTED_COLOR);
947
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-width", EXPECTED_WIDTH);
948
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-style", EXPECTED_STYLE);
949
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
950
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
951
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
952
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-color", EXPECTED_COLOR);
953
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
954
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-style", EXPECTED_STYLE);
955
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-color", EXPECTED_COLOR);
956
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-width", EXPECTED_WIDTH);
957
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-style", EXPECTED_STYLE);
958
+ }));
959
+ (0, fixtures_1.test)("theme borderHorizontal applies to left and right", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
960
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
961
+ const EXPECTED_WIDTH = "5px";
962
+ const EXPECTED_STYLE = "dotted";
963
+ yield initTestBed('<Avatar name="Tim"/>', {
964
+ testThemeVars: {
965
+ "borderHorizontal-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
966
+ },
967
+ });
968
+ const component = (yield createAvatarDriver()).component;
969
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-color", EXPECTED_COLOR);
970
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-width", EXPECTED_WIDTH);
971
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-style", EXPECTED_STYLE);
972
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
973
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
974
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
975
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-color", EXPECTED_COLOR);
976
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
977
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-style", EXPECTED_STYLE);
978
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
979
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
980
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
981
+ }));
982
+ (0, fixtures_1.test)("theme borderLeft overrides borderHorizontal", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
983
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
984
+ const EXPECTED_WIDTH = "5px";
985
+ const EXPECTED_STYLE = "dotted";
986
+ yield initTestBed('<Avatar name="Tim"/>', {
987
+ testThemeVars: {
988
+ "borderHorizontal-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
989
+ "borderLeft-Avatar": "8px double rgb(0, 128, 0)",
990
+ },
991
+ });
992
+ const component = (yield createAvatarDriver()).component;
993
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-color", EXPECTED_COLOR);
994
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-width", EXPECTED_WIDTH);
995
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-style", EXPECTED_STYLE);
996
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
997
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
998
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
999
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1000
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1001
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1002
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", "rgb(0, 128, 0)");
1003
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", "8px");
1004
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", "double");
1005
+ }));
1006
+ (0, fixtures_1.test)("theme borderRight overrides borderHorizontal", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1007
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1008
+ const EXPECTED_WIDTH = "5px";
1009
+ const EXPECTED_STYLE = "dotted";
1010
+ yield initTestBed('<Avatar name="Tim"/>', {
1011
+ testThemeVars: {
1012
+ "borderHorizontal-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1013
+ "borderRight-Avatar": "8px double rgb(0, 128, 0)",
1014
+ },
1015
+ });
1016
+ const component = (yield createAvatarDriver()).component;
1017
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-color", EXPECTED_COLOR);
1018
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-width", EXPECTED_WIDTH);
1019
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-style", EXPECTED_STYLE);
1020
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", "rgb(0, 128, 0)");
1021
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", "8px");
1022
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", "double");
1023
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1024
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1025
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1026
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1027
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1028
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1029
+ }));
1030
+ (0, fixtures_1.test)("theme borderTop applies to top side", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
1031
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1032
+ const EXPECTED_WIDTH = "5px";
1033
+ const EXPECTED_STYLE = "dotted";
1034
+ yield initTestBed('<Avatar name="Tim"/>', {
1035
+ testThemeVars: {
1036
+ "borderTop-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1037
+ },
1038
+ });
1039
+ const component = (yield createAvatarDriver()).component;
1040
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1041
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1042
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1043
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-color", EXPECTED_COLOR);
1044
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-width", EXPECTED_WIDTH);
1045
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-style", EXPECTED_STYLE);
1046
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1047
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1048
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1049
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-color", EXPECTED_COLOR);
1050
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-width", EXPECTED_WIDTH);
1051
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-style", EXPECTED_STYLE);
1052
+ }));
1053
+ (0, fixtures_1.test)("theme borderBottom applies to bottom side", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
1054
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1055
+ const EXPECTED_WIDTH = "5px";
1056
+ const EXPECTED_STYLE = "dotted";
1057
+ yield initTestBed('<Avatar name="Tim"/>', {
1058
+ testThemeVars: {
1059
+ "borderBottom-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1060
+ },
1061
+ });
1062
+ const component = (yield createAvatarDriver()).component;
1063
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-color", EXPECTED_COLOR);
1064
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-width", EXPECTED_WIDTH);
1065
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-style", EXPECTED_STYLE);
1066
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-color", EXPECTED_COLOR);
1067
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-width", EXPECTED_WIDTH);
1068
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-style", EXPECTED_STYLE);
1069
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1070
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1071
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1072
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-color", EXPECTED_COLOR);
1073
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-width", EXPECTED_WIDTH);
1074
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-style", EXPECTED_STYLE);
1075
+ }));
1076
+ (0, fixtures_1.test)("theme borderVertical applies to top and bottom", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1077
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1078
+ const EXPECTED_WIDTH = "5px";
1079
+ const EXPECTED_STYLE = "dotted";
1080
+ yield initTestBed('<Avatar name="Tim"/>', {
1081
+ testThemeVars: {
1082
+ "borderVertical-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1083
+ },
1084
+ });
1085
+ const component = (yield createAvatarDriver()).component;
1086
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1087
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1088
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1089
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-color", EXPECTED_COLOR);
1090
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-width", EXPECTED_WIDTH);
1091
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-style", EXPECTED_STYLE);
1092
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1093
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1094
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1095
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-color", EXPECTED_COLOR);
1096
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-width", EXPECTED_WIDTH);
1097
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-style", EXPECTED_STYLE);
1098
+ }));
1099
+ (0, fixtures_1.test)("theme borderTop overrides borderVertical", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
1100
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1101
+ const EXPECTED_WIDTH = "5px";
1102
+ const EXPECTED_STYLE = "dotted";
1103
+ yield initTestBed('<Avatar name="Tim"/>', {
1104
+ testThemeVars: {
1105
+ "borderVertical-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1106
+ "borderTop-Avatar": "8px double rgb(0, 128, 0)",
1107
+ },
1108
+ });
1109
+ const component = (yield createAvatarDriver()).component;
1110
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", "rgb(0, 128, 0)");
1111
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", "8px");
1112
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", "double");
1113
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-color", EXPECTED_COLOR);
1114
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-width", EXPECTED_WIDTH);
1115
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-style", EXPECTED_STYLE);
1116
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1117
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1118
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1119
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-color", EXPECTED_COLOR);
1120
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-width", EXPECTED_WIDTH);
1121
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-style", EXPECTED_STYLE);
1122
+ }));
1123
+ (0, fixtures_1.test)("theme borderBottom overrides borderVertical", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1124
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1125
+ const EXPECTED_WIDTH = "5px";
1126
+ const EXPECTED_STYLE = "dotted";
1127
+ yield initTestBed('<Avatar name="Tim"/>', {
1128
+ testThemeVars: {
1129
+ "borderVertical-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1130
+ "borderBottom-Avatar": "8px double rgb(0, 128, 0)",
1131
+ },
1132
+ });
1133
+ const component = (yield createAvatarDriver()).component;
1134
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1135
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1136
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1137
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-color", EXPECTED_COLOR);
1138
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-width", EXPECTED_WIDTH);
1139
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-style", EXPECTED_STYLE);
1140
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", "rgb(0, 128, 0)");
1141
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", "8px");
1142
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", "double");
1143
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-color", EXPECTED_COLOR);
1144
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-width", EXPECTED_WIDTH);
1145
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-style", EXPECTED_STYLE);
1146
+ }));
1147
+ (0, fixtures_1.test)("theme borderColor applies to all sides", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
1148
+ const EXPECTED_COLOR = "rgb(0, 128, 0)";
1149
+ const EXPECTED_WIDTH = "5px";
1150
+ const EXPECTED_STYLE = "dotted";
1151
+ yield initTestBed('<Avatar name="Tim"/>', {
1152
+ testThemeVars: {
1153
+ "borderColor-Avatar": EXPECTED_COLOR,
1154
+ },
1155
+ });
1156
+ const component = (yield createAvatarDriver()).component;
1157
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1158
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-width", EXPECTED_WIDTH);
1159
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-style", EXPECTED_STYLE);
1160
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1161
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-width", EXPECTED_WIDTH);
1162
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-style", EXPECTED_STYLE);
1163
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1164
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1165
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1166
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1167
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-width", EXPECTED_WIDTH);
1168
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-style", EXPECTED_STYLE);
1169
+ }));
1170
+ (0, fixtures_1.test)("theme borderColor overrides border color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
1171
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1172
+ const EXPECTED_WIDTH = "5px";
1173
+ const EXPECTED_STYLE = "dotted";
1174
+ const UPDATED = "rgb(0, 128, 0)";
1175
+ yield initTestBed('<Avatar name="Tim"/>', {
1176
+ testThemeVars: {
1177
+ "borderColor-Avatar": UPDATED,
1178
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1179
+ },
1180
+ });
1181
+ const component = (yield createAvatarDriver()).component;
1182
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", UPDATED);
1183
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1184
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1185
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", UPDATED);
1186
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1187
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1188
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", UPDATED);
1189
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1190
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1191
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", UPDATED);
1192
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1193
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1194
+ }));
1195
+ (0, fixtures_1.test)("theme borderHorizontalColor overrides border color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1196
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1197
+ const EXPECTED_WIDTH = "5px";
1198
+ const EXPECTED_STYLE = "dotted";
1199
+ const UPDATED = "rgb(0, 128, 0)";
1200
+ yield initTestBed('<Avatar name="Tim"/>', {
1201
+ testThemeVars: {
1202
+ "borderHorizontalColor-Avatar": UPDATED,
1203
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1204
+ },
1205
+ });
1206
+ const component = (yield createAvatarDriver()).component;
1207
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1208
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1209
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1210
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", UPDATED);
1211
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1212
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1213
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1214
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1215
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1216
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", UPDATED);
1217
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1218
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1219
+ }));
1220
+ (0, fixtures_1.test)("theme borderLeftColor overrides border color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1221
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1222
+ const EXPECTED_WIDTH = "5px";
1223
+ const EXPECTED_STYLE = "dotted";
1224
+ const UPDATED = "rgb(0, 128, 0)";
1225
+ yield initTestBed('<Avatar name="Tim"/>', {
1226
+ testThemeVars: {
1227
+ "borderLeftColor-Avatar": UPDATED,
1228
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1229
+ },
1230
+ });
1231
+ const component = (yield createAvatarDriver()).component;
1232
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1233
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1234
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1235
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1236
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1237
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1238
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1239
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1240
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1241
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", UPDATED);
1242
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1243
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1244
+ }));
1245
+ (0, fixtures_1.test)("theme borderRightColor overrides border color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1246
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1247
+ const EXPECTED_WIDTH = "5px";
1248
+ const EXPECTED_STYLE = "dotted";
1249
+ const UPDATED = "rgb(0, 128, 0)";
1250
+ yield initTestBed('<Avatar name="Tim"/>', {
1251
+ testThemeVars: {
1252
+ "borderRightColor-Avatar": UPDATED,
1253
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1254
+ },
1255
+ });
1256
+ const component = (yield createAvatarDriver()).component;
1257
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1258
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1259
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1260
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", UPDATED);
1261
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1262
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1263
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1264
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1265
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1266
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1267
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1268
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1269
+ }));
1270
+ (0, fixtures_1.test)("theme borderVerticalColor overrides border color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1271
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1272
+ const EXPECTED_WIDTH = "5px";
1273
+ const EXPECTED_STYLE = "dotted";
1274
+ const UPDATED = "rgb(0, 128, 0)";
1275
+ yield initTestBed('<Avatar name="Tim"/>', {
1276
+ testThemeVars: {
1277
+ "borderVerticalColor-Avatar": UPDATED,
1278
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1279
+ },
1280
+ });
1281
+ const component = (yield createAvatarDriver()).component;
1282
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", UPDATED);
1283
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1284
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1285
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1286
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1287
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1288
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", UPDATED);
1289
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1290
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1291
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1292
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1293
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1294
+ }));
1295
+ (0, fixtures_1.test)("theme borderTopColor overrides border color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1296
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1297
+ const EXPECTED_WIDTH = "5px";
1298
+ const EXPECTED_STYLE = "dotted";
1299
+ const UPDATED = "rgb(0, 128, 0)";
1300
+ yield initTestBed('<Avatar name="Tim"/>', {
1301
+ testThemeVars: {
1302
+ "borderTopColor-Avatar": UPDATED,
1303
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1304
+ },
1305
+ });
1306
+ const component = (yield createAvatarDriver()).component;
1307
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", UPDATED);
1308
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1309
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1310
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1311
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1312
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1313
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1314
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1315
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1316
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1317
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1318
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1319
+ }));
1320
+ (0, fixtures_1.test)("theme borderBottomColor overrides border color", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1321
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1322
+ const EXPECTED_WIDTH = "5px";
1323
+ const EXPECTED_STYLE = "dotted";
1324
+ const UPDATED = "rgb(0, 128, 0)";
1325
+ yield initTestBed('<Avatar name="Tim"/>', {
1326
+ testThemeVars: {
1327
+ "borderBottomColor-Avatar": UPDATED,
1328
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1329
+ },
1330
+ });
1331
+ const component = (yield createAvatarDriver()).component;
1332
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1333
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1334
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1335
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1336
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1337
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1338
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", UPDATED);
1339
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1340
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1341
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1342
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1343
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1344
+ }));
1345
+ (0, fixtures_1.test)("theme borderStyle applies to all sides", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
1346
+ const EXPECTED_COLOR = "rgb(0, 128, 0)";
1347
+ const EXPECTED_WIDTH = "5px";
1348
+ const EXPECTED_STYLE = "dotted";
1349
+ yield initTestBed('<Avatar name="Tim"/>', {
1350
+ testThemeVars: {
1351
+ "borderStyle-Avatar": EXPECTED_STYLE,
1352
+ },
1353
+ });
1354
+ const component = (yield createAvatarDriver()).component;
1355
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-color", EXPECTED_COLOR);
1356
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-top-width", EXPECTED_WIDTH);
1357
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1358
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-color", EXPECTED_COLOR);
1359
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-right-width", EXPECTED_WIDTH);
1360
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1361
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1362
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1363
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1364
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-color", EXPECTED_COLOR);
1365
+ yield (0, fixtures_1.expect)(component).not.toHaveCSS("border-left-width", EXPECTED_WIDTH);
1366
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1367
+ }));
1368
+ (0, fixtures_1.test)("theme borderStyle overrides border style", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
1369
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1370
+ const EXPECTED_WIDTH = "5px";
1371
+ const EXPECTED_STYLE = "dotted";
1372
+ const UPDATED = "double";
1373
+ yield initTestBed('<Avatar name="Tim"/>', {
1374
+ testThemeVars: {
1375
+ "borderStyle-Avatar": UPDATED,
1376
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1377
+ },
1378
+ });
1379
+ const component = (yield createAvatarDriver()).component;
1380
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1381
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1382
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", UPDATED);
1383
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1384
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1385
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", UPDATED);
1386
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1387
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1388
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", UPDATED);
1389
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1390
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1391
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", UPDATED);
1392
+ }));
1393
+ (0, fixtures_1.test)("theme borderHorizontalWidth overrides border width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1394
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1395
+ const EXPECTED_WIDTH = "5px";
1396
+ const EXPECTED_STYLE = "dotted";
1397
+ const UPDATED = "12px";
1398
+ yield initTestBed('<Avatar name="Tim"/>', {
1399
+ testThemeVars: {
1400
+ "borderHorizontalWidth-Avatar": UPDATED,
1401
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1402
+ },
1403
+ });
1404
+ const component = (yield createAvatarDriver()).component;
1405
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1406
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1407
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1408
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1409
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", UPDATED);
1410
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1411
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1412
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1413
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1414
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1415
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", UPDATED);
1416
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1417
+ }));
1418
+ (0, fixtures_1.test)("theme borderLeftWidth overrides border width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1419
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1420
+ const EXPECTED_WIDTH = "5px";
1421
+ const EXPECTED_STYLE = "dotted";
1422
+ const UPDATED = "12px";
1423
+ yield initTestBed('<Avatar name="Tim"/>', {
1424
+ testThemeVars: {
1425
+ "borderLeftWidth-Avatar": UPDATED,
1426
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1427
+ },
1428
+ });
1429
+ const component = (yield createAvatarDriver()).component;
1430
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1431
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1432
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1433
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1434
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1435
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1436
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1437
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1438
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1439
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1440
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", UPDATED);
1441
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1442
+ }));
1443
+ (0, fixtures_1.test)("theme borderRightWidth overrides border width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1444
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1445
+ const EXPECTED_WIDTH = "5px";
1446
+ const EXPECTED_STYLE = "dotted";
1447
+ const UPDATED = "12px";
1448
+ yield initTestBed('<Avatar name="Tim"/>', {
1449
+ testThemeVars: {
1450
+ "borderRightWidth-Avatar": UPDATED,
1451
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1452
+ },
1453
+ });
1454
+ const component = (yield createAvatarDriver()).component;
1455
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1456
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1457
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1458
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1459
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", UPDATED);
1460
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1461
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1462
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1463
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1464
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1465
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1466
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1467
+ }));
1468
+ (0, fixtures_1.test)("theme borderVerticalWidth overrides border width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1469
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1470
+ const EXPECTED_WIDTH = "5px";
1471
+ const EXPECTED_STYLE = "dotted";
1472
+ const UPDATED = "12px";
1473
+ yield initTestBed('<Avatar name="Tim"/>', {
1474
+ testThemeVars: {
1475
+ "borderVerticalWidth-Avatar": UPDATED,
1476
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1477
+ },
1478
+ });
1479
+ const component = (yield createAvatarDriver()).component;
1480
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1481
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", UPDATED);
1482
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1483
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1484
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1485
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1486
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1487
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", UPDATED);
1488
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1489
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1490
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1491
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1492
+ }));
1493
+ (0, fixtures_1.test)("theme borderTopWidth overrides border width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1494
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1495
+ const EXPECTED_WIDTH = "5px";
1496
+ const EXPECTED_STYLE = "dotted";
1497
+ const UPDATED = "12px";
1498
+ yield initTestBed('<Avatar name="Tim"/>', {
1499
+ testThemeVars: {
1500
+ "borderTopWidth-Avatar": UPDATED,
1501
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1502
+ },
1503
+ });
1504
+ const component = (yield createAvatarDriver()).component;
1505
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1506
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", UPDATED);
1507
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1508
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1509
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1510
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1511
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1512
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", EXPECTED_WIDTH);
1513
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1514
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1515
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1516
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1517
+ }));
1518
+ (0, fixtures_1.test)("theme borderBottomWidth overrides border width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
1519
+ const EXPECTED_COLOR = "rgb(255, 0, 0)";
1520
+ const EXPECTED_WIDTH = "5px";
1521
+ const EXPECTED_STYLE = "dotted";
1522
+ const UPDATED = "12px";
1523
+ yield initTestBed('<Avatar name="Tim"/>', {
1524
+ testThemeVars: {
1525
+ "borderBottomWidth-Avatar": UPDATED,
1526
+ "border-Avatar": `${EXPECTED_STYLE} ${EXPECTED_COLOR} ${EXPECTED_WIDTH}`,
1527
+ },
1528
+ });
1529
+ const component = (yield createAvatarDriver()).component;
1530
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-color", EXPECTED_COLOR);
1531
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-width", EXPECTED_WIDTH);
1532
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-top-style", EXPECTED_STYLE);
1533
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-color", EXPECTED_COLOR);
1534
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-width", EXPECTED_WIDTH);
1535
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-right-style", EXPECTED_STYLE);
1536
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-color", EXPECTED_COLOR);
1537
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-width", UPDATED);
1538
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-bottom-style", EXPECTED_STYLE);
1539
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-color", EXPECTED_COLOR);
1540
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-width", EXPECTED_WIDTH);
1541
+ yield (0, fixtures_1.expect)(component).toHaveCSS("border-left-style", EXPECTED_STYLE);
1542
+ }));
1543
+ });