xmlui 0.10.12 → 0.10.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{index-CDOoBf2R.mjs → index-779mp2Bm.mjs} +1508 -1287
- package/dist/lib/index.css +1 -1
- package/dist/lib/{initMock-BAV9RKui.mjs → initMock-CAXdczCj.mjs} +1 -1
- package/dist/lib/scss/components-core/theming/_themes.scss +1 -1
- package/dist/lib/xmlui.d.ts +17 -2
- package/dist/lib/xmlui.mjs +33 -32
- package/dist/metadata/{collectedComponentMetadata-Dp8BqWQO.mjs → collectedComponentMetadata-7DFXlw-J.mjs} +14957 -14751
- package/dist/metadata/{initMock-BvEO8W8r.mjs → initMock-AFWEftc6.mjs} +1 -1
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +3 -3
- package/dist/scripts/bin/build-lib.js +21 -13
- package/dist/scripts/bin/viteConfig.js +3 -1
- package/dist/scripts/package.json +1 -1
- package/dist/scripts/src/abstractions/scripting/Token.js +2 -0
- package/dist/scripts/src/abstractions/scripting/TryScope.js +2 -0
- package/dist/scripts/src/abstractions/scripting/modules.js +2 -0
- package/dist/scripts/src/components/APICall/APICall.spec.js +910 -0
- package/dist/scripts/src/components/Accordion/Accordion.spec.js +969 -0
- package/dist/scripts/src/components/Animation/Animation.js +50 -0
- package/dist/scripts/src/components/App/App.spec.js +219 -0
- package/dist/scripts/src/components/AppHeader/AppHeader.spec.js +169 -0
- package/dist/scripts/src/components/AppState/AppState.spec.js +268 -0
- package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +383 -0
- package/dist/scripts/src/components/Avatar/Avatar.spec.js +1543 -0
- package/dist/scripts/src/components/Backdrop/Backdrop.spec.js +131 -0
- package/dist/scripts/src/components/Badge/Badge.spec.js +2214 -0
- package/dist/scripts/src/components/Bookmark/Bookmark.spec.js +230 -0
- package/dist/scripts/src/components/Breakout/Breakout.spec.js +56 -0
- package/dist/scripts/src/components/Button/Button-style.spec.js +274 -0
- package/dist/scripts/src/components/Button/Button.spec.js +454 -0
- package/dist/scripts/src/components/Card/Card.spec.js +150 -0
- package/dist/scripts/src/components/Carousel/Carousel.spec.js +343 -0
- package/dist/scripts/src/components/Carousel/CarouselNative.js +2 -2
- package/dist/scripts/src/components/ChangeListener/ChangeListener.spec.js +169 -0
- package/dist/scripts/src/components/Charts/AreaChart/AreaChart.spec.js +999 -0
- package/dist/scripts/src/components/Charts/BarChart/BarChart.spec.js +597 -0
- package/dist/scripts/src/components/Charts/DonutChart/DonutChart.spec.js +608 -0
- package/dist/scripts/src/components/Charts/LabelList/LabelList.spec.js +539 -0
- package/dist/scripts/src/components/Charts/Legend/Legend.spec.js +558 -0
- package/dist/scripts/src/components/Charts/LineChart/LineChart.spec.js +450 -0
- package/dist/scripts/src/components/Charts/PieChart/PieChart.spec.js +584 -0
- package/dist/scripts/src/components/Charts/RadarChart/RadarChart.spec.js +571 -0
- package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +449 -0
- package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +964 -0
- package/dist/scripts/src/components/CodeBlock/CodeBlock.spec.js +196 -0
- package/dist/scripts/src/components/ColorPicker/ColorPicker.js +3 -3
- package/dist/scripts/src/components/ColorPicker/ColorPicker.spec.js +283 -0
- package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +16 -5
- package/dist/scripts/src/components/Column/doc-resources/list-component-data.js +53 -0
- package/dist/scripts/src/components/ComponentProvider.js +6 -6
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +338 -0
- package/dist/scripts/src/components/DateInput/DateInput.spec.js +918 -0
- package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +362 -0
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +3 -3
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +331 -0
- package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +1 -1
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.spec.js +29 -0
- package/dist/scripts/src/components/ExpandableItem/ExpandableItem.spec.js +435 -0
- package/dist/scripts/src/components/FileInput/FileInput.spec.js +249 -0
- package/dist/scripts/src/components/FileInput/FileInputNative.js +14 -10
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.spec.js +296 -0
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +1 -1
- package/dist/scripts/src/components/FlowLayout/FlowLayout.spec.js +518 -0
- package/dist/scripts/src/components/Footer/Footer.spec.js +991 -0
- package/dist/scripts/src/components/Form/Form.js +6 -0
- package/dist/scripts/src/components/Form/Form.spec.js +1257 -0
- package/dist/scripts/src/components/Form/FormNative.js +13 -3
- package/dist/scripts/src/components/FormItem/FormItem.spec.js +723 -0
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +2 -2
- package/dist/scripts/src/components/FormSection/FormSection.js +6 -31
- package/dist/scripts/src/components/Fragment/Fragment.js +5 -1
- package/dist/scripts/src/components/Fragment/Fragment.spec.js +50 -0
- package/dist/scripts/src/components/Heading/H1.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H2.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H3.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H4.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H5.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H6.spec.js +66 -0
- package/dist/scripts/src/components/Heading/Heading.js +0 -12
- package/dist/scripts/src/components/Heading/Heading.spec.js +897 -0
- package/dist/scripts/src/components/HtmlTags/HtmlTags.spec.js +69 -0
- package/dist/scripts/src/components/IFrame/IFrame.spec.js +527 -0
- package/dist/scripts/src/components/Icon/ArrowDropDown.js +11 -0
- package/dist/scripts/src/components/Icon/ArrowDropUp.js +11 -0
- package/dist/scripts/src/components/Icon/ArrowLeft.js +11 -0
- package/dist/scripts/src/components/Icon/ArrowRight.js +11 -0
- package/dist/scripts/src/components/Icon/ChevronDownIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronUpIcon.js +7 -0
- package/dist/scripts/src/components/Icon/Icon.spec.js +527 -0
- package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
- package/dist/scripts/src/components/Image/Image.js +2 -1
- package/dist/scripts/src/components/Image/Image.spec.js +198 -0
- package/dist/scripts/src/components/Image/ImageNative.js +30 -2
- package/dist/scripts/src/components/Input/InputLabel.js +25 -0
- package/dist/scripts/src/components/Input/index.js +5 -0
- package/dist/scripts/src/components/Items/Items.spec.js +397 -0
- package/dist/scripts/src/components/Link/Link.spec.js +894 -0
- package/dist/scripts/src/components/List/List.spec.js +927 -0
- package/dist/scripts/src/components/List/doc-resources/list-component-data.js +53 -0
- package/dist/scripts/src/components/Markdown/Markdown.spec.js +188 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +1 -1
- package/dist/scripts/src/components/ModalDialog/ModalDialog.spec.js +162 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +1 -1
- package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +153 -0
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +2 -2
- package/dist/scripts/src/components/NavLink/NavLink.spec.js +864 -0
- package/dist/scripts/src/components/NavPanel/NavPanel.spec.js +864 -0
- package/dist/scripts/src/components/NoResult/NoResult.spec.js +863 -0
- package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +1231 -0
- package/dist/scripts/src/components/Option/Option.spec.js +472 -0
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.spec.js +80 -0
- package/dist/scripts/src/components/Pagination/Pagination.spec.js +1003 -0
- package/dist/scripts/src/components/ProfileMenu/ProfileMenu.js +20 -0
- package/dist/scripts/src/components/ProgressBar/ProgressBar.spec.js +166 -0
- package/dist/scripts/src/components/Queue/Queue.spec.js +626 -0
- package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +479 -0
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +17 -1
- package/dist/scripts/src/components/Redirect/Redirect.spec.js +527 -0
- package/dist/scripts/src/components/ResponsiveBar/ResponsiveBar.spec.js +76 -0
- package/dist/scripts/src/components/Select/Select.spec.js +527 -0
- package/dist/scripts/src/components/Slider/Slider.js +2 -0
- package/dist/scripts/src/components/Slider/Slider.spec.js +574 -0
- package/dist/scripts/src/components/Slider/SliderNative.js +62 -25
- package/dist/scripts/src/components/Slot/Slot.spec.js +368 -0
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.spec.js +184 -0
- package/dist/scripts/src/components/Spinner/Spinner.spec.js +161 -0
- package/dist/scripts/src/components/Splitter/HSplitter.spec.js +104 -0
- package/dist/scripts/src/components/Splitter/Splitter.spec.js +543 -0
- package/dist/scripts/src/components/Splitter/VSplitter.spec.js +104 -0
- package/dist/scripts/src/components/Stack/CHStack.spec.js +86 -0
- package/dist/scripts/src/components/Stack/CVStack.spec.js +86 -0
- package/dist/scripts/src/components/Stack/HStack.spec.js +67 -0
- package/dist/scripts/src/components/Stack/Stack.spec.js +654 -0
- package/dist/scripts/src/components/Stack/VStack.spec.js +67 -0
- package/dist/scripts/src/components/Switch/Switch.spec.js +829 -0
- package/dist/scripts/src/components/Table/Table.js +8 -5
- package/dist/scripts/src/components/Table/Table.spec.js +555 -0
- package/dist/scripts/src/components/Table/TableNative.js +1 -1
- package/dist/scripts/src/components/Table/doc-resources/list-component-data.js +53 -0
- package/dist/scripts/src/components/TableOfContents/TableOfContents.spec.js +838 -0
- package/dist/scripts/src/components/Tabs/Tabs.spec.js +875 -0
- package/dist/scripts/src/components/Text/Text.js +0 -13
- package/dist/scripts/src/components/Text/Text.spec.js +1075 -0
- package/dist/scripts/src/components/TextArea/TextArea.spec.js +714 -0
- package/dist/scripts/src/components/TextArea/TextAreaNative.js +8 -1
- package/dist/scripts/src/components/TextBox/TextBox.spec.js +643 -0
- package/dist/scripts/src/components/Theme/NotificationToast.js +4 -1
- package/dist/scripts/src/components/Theme/Theme.spec.js +124 -0
- package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +1122 -0
- package/dist/scripts/src/components/Timer/Timer.spec.js +358 -0
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.spec.js +414 -0
- package/dist/scripts/src/components/ToneSwitch/ToneSwitch.spec.js +89 -0
- package/dist/scripts/src/components/Tooltip/Tooltip.spec.js +418 -0
- package/dist/scripts/src/components/chart-color-schemes.js +43 -0
- package/dist/scripts/src/components-core/CompoundComponent.js +5 -5
- package/dist/scripts/src/components-core/RestApiProxy.js +89 -11
- package/dist/scripts/src/components-core/devtools/InspectorDialogVisibilityContext.js +8 -0
- package/dist/scripts/src/components-core/renderers.js +31 -0
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +1 -1
- package/dist/scripts/src/components-core/rendering/Container.js +19 -8
- package/dist/scripts/src/components-core/rendering/reducer.js +1 -1
- package/dist/scripts/src/components-core/script-runner/simplify-expression.js +386 -0
- package/dist/scripts/src/components-core/theming/component-layout-resolver.js +153 -0
- package/dist/scripts/src/components-core/theming/parse-layout-props.js +98 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +13 -20
- package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
- package/dist/scripts/src/components-core/utils/audio-utils.js +83 -0
- package/dist/scripts/src/index-standalone.js +61 -0
- package/dist/scripts/src/index.js +2 -1
- package/dist/scripts/src/language-server/server-common.js +151 -0
- package/dist/scripts/src/language-server/server-web-worker.js +47 -0
- package/dist/scripts/src/language-server/server.js +42 -0
- package/dist/scripts/src/language-server/services/common/docs-generation.js +73 -0
- package/dist/scripts/src/language-server/services/common/lsp-utils.js +9 -0
- package/dist/scripts/src/language-server/services/common/syntax-node-utilities.js +135 -0
- package/dist/scripts/src/language-server/services/completion.js +270 -0
- package/dist/scripts/src/language-server/services/diagnostic.js +19 -0
- package/dist/scripts/src/language-server/services/format.js +430 -0
- package/dist/scripts/src/language-server/services/hover.js +164 -0
- package/dist/scripts/src/language-server/xmlui-metadata-generated.mjs +16266 -0
- package/dist/scripts/src/logging/xmlui.js +21 -0
- package/dist/scripts/src/parsers/common/utils.js +19 -0
- package/dist/scripts/src/syntax/monaco/grammar.monacoLanguage.js +286 -0
- package/dist/scripts/src/syntax/monaco/index.js +14 -0
- package/dist/scripts/src/syntax/monaco/xmlui-dark.js +25 -0
- package/dist/scripts/src/syntax/monaco/xmlui-light.js +25 -0
- package/dist/scripts/src/syntax/monaco/xmluiscript.monacoLanguage.js +310 -0
- package/dist/scripts/src/syntax/textMate/index.js +14 -0
- package/dist/scripts/src/syntax/textMate/xmlui-dark.json +631 -0
- package/dist/scripts/src/syntax/textMate/xmlui-light.json +565 -0
- package/dist/scripts/src/syntax/textMate/xmlui.json +564 -0
- package/dist/scripts/src/syntax/textMate/xmlui.tmLanguage.json +341 -0
- package/dist/scripts/src/testing/ComponentDrivers.js +1355 -0
- package/dist/scripts/src/testing/assertions.js +444 -0
- package/dist/scripts/src/testing/component-test-helpers.js +389 -0
- package/dist/scripts/src/testing/drivers/DateInputDriver.js +19 -0
- package/dist/scripts/src/testing/drivers/ModalDialogDriver.js +10 -0
- package/dist/scripts/src/testing/drivers/TimeInputDriver.js +22 -0
- package/dist/scripts/src/testing/drivers/TimerDriver.js +64 -0
- package/dist/scripts/src/testing/fixtures.js +487 -0
- package/dist/scripts/src/testing/infrastructure/TestBed.js +17 -0
- package/dist/scripts/src/testing/infrastructure/main.js +9 -0
- package/dist/scripts/src/testing/infrastructure/public/mockServiceWorker.js +266 -0
- package/dist/scripts/src/testing/themed-app-test-helpers.js +139 -0
- package/dist/standalone/xmlui-standalone.es.d.ts +19 -2
- package/dist/standalone/xmlui-standalone.umd.js +36 -36
- package/package.json +1 -1
- package/dist/scripts/src/components/RadioGroup/RadioItem.js +0 -28
|
@@ -27,7 +27,7 @@ exports.defaultProps = {
|
|
|
27
27
|
};
|
|
28
28
|
const numberRegex = /^[0-9]+$/;
|
|
29
29
|
exports.ItemWithLabel = (0, react_1.forwardRef)(function ItemWithLabel(_a, ref) {
|
|
30
|
-
var { id, labelPosition = "top", style = {}, className, label, labelBreak = exports.defaultProps.labelBreak, labelWidth, enabled = true, required = false, children, validationInProgress = false, shrinkToLabel = false, onFocus, onBlur, labelStyle, validationResult, isInputTemplateUsed = false } = _a, rest = __rest(_a, ["id", "labelPosition", "style", "className", "label", "labelBreak", "labelWidth", "enabled", "required", "children", "validationInProgress", "shrinkToLabel", "onFocus", "onBlur", "labelStyle", "validationResult", "isInputTemplateUsed"]);
|
|
30
|
+
var { id, labelPosition = "top", style = {}, className, label, labelBreak = exports.defaultProps.labelBreak, labelWidth, enabled = true, required = false, children, validationInProgress = false, shrinkToLabel = false, onFocus, onBlur, labelStyle, validationResult, isInputTemplateUsed = false, onLabelClick } = _a, rest = __rest(_a, ["id", "labelPosition", "style", "className", "label", "labelBreak", "labelWidth", "enabled", "required", "children", "validationInProgress", "shrinkToLabel", "onFocus", "onBlur", "labelStyle", "validationResult", "isInputTemplateUsed", "onLabelClick"]);
|
|
31
31
|
// --- HACK: the "rest" may contain a "layoutContext" property that React doesn't recognize
|
|
32
32
|
// --- as a valid DOM attribute, which would issue a warning in React.
|
|
33
33
|
if (rest.layoutContext !== undefined) {
|
|
@@ -53,7 +53,7 @@ exports.ItemWithLabel = (0, react_1.forwardRef)(function ItemWithLabel(_a, ref)
|
|
|
53
53
|
[FormItem_module_scss_1.default.start]: labelPosition === "start",
|
|
54
54
|
[FormItem_module_scss_1.default.end]: labelPosition === "end",
|
|
55
55
|
[FormItem_module_scss_1.default.shrinkToLabel]: shrinkToLabel,
|
|
56
|
-
}), children: [label && ((0, jsx_runtime_1.jsxs)("label", { "data-part-id": parts_1.PART_LABEL, htmlFor: inputId, onClick: () => { var _a; return (_a = document.getElementById(inputId)) === null || _a === void 0 ? void 0 : _a.focus(); }, style: Object.assign(Object.assign({}, labelStyle), { width: labelWidth && numberRegex.test(labelWidth) ? `${labelWidth}px` : labelWidth, flexShrink: labelWidth !== undefined ? 0 : undefined }), className: (0, classnames_1.default)(FormItem_module_scss_1.default.inputLabel, {
|
|
56
|
+
}), children: [label && ((0, jsx_runtime_1.jsxs)("label", { "data-part-id": parts_1.PART_LABEL, htmlFor: inputId, onClick: onLabelClick || (() => { var _a; return (_a = document.getElementById(inputId)) === null || _a === void 0 ? void 0 : _a.focus(); }), style: Object.assign(Object.assign({}, labelStyle), { width: labelWidth && numberRegex.test(labelWidth) ? `${labelWidth}px` : labelWidth, flexShrink: labelWidth !== undefined ? 0 : undefined }), className: (0, classnames_1.default)(FormItem_module_scss_1.default.inputLabel, {
|
|
57
57
|
[FormItem_module_scss_1.default.required]: required,
|
|
58
58
|
[FormItem_module_scss_1.default.disabled]: !enabled,
|
|
59
59
|
[FormItem_module_scss_1.default.labelBreak]: labelBreak,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.formSectionRenderer = exports.FormSectionMd = void 0;
|
|
4
|
-
const
|
|
7
|
+
const renderers_1 = require("../../components-core/renderers");
|
|
5
8
|
const metadata_helpers_1 = require("../metadata-helpers");
|
|
6
|
-
|
|
7
|
-
// import componentSource from "./FormSection.xmlui?raw";
|
|
9
|
+
const FormSection_xmlui_1 = __importDefault(require("./FormSection.xmlui"));
|
|
8
10
|
const COMP = "FormSection";
|
|
9
11
|
exports.FormSectionMd = (0, metadata_helpers_1.createMetadata)({
|
|
10
12
|
status: "experimental",
|
|
@@ -51,31 +53,4 @@ exports.FormSectionMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
51
53
|
},
|
|
52
54
|
},
|
|
53
55
|
});
|
|
54
|
-
|
|
55
|
-
<Component name="FormSection">
|
|
56
|
-
<VStack paddingBottom="{$props.paddingBottom ?? '1rem'}" gap="0" width="100%">
|
|
57
|
-
<Heading
|
|
58
|
-
when="{!!$props.heading}"
|
|
59
|
-
marginBottom="$space-tight"
|
|
60
|
-
level="{$props.headingLevel ?? 'h3'}"
|
|
61
|
-
fontWeight="{$props.headingWeight ?? 'bold'}"
|
|
62
|
-
value="{$props.heading}" />
|
|
63
|
-
<Text
|
|
64
|
-
when="{!!$props.info}"
|
|
65
|
-
fontSize="{$props.infoFontSize ?? '0.8rem'}"
|
|
66
|
-
paddingBottom="$space-normal"
|
|
67
|
-
value="{$props.info}" />
|
|
68
|
-
<FlowLayout
|
|
69
|
-
width="100%"
|
|
70
|
-
paddingTop="{$props.paddingTop ?? '$space-normal'}"
|
|
71
|
-
columnGap="{$props.columnGap ?? '3rem'}"
|
|
72
|
-
rowGap="{$props.rowGap ?? '$space-normal'}" >
|
|
73
|
-
<Slot />
|
|
74
|
-
</FlowLayout>
|
|
75
|
-
</VStack>
|
|
76
|
-
</Component>
|
|
77
|
-
`;
|
|
78
|
-
exports.formSectionRenderer = {
|
|
79
|
-
compoundComponentDef: (0, compound_utils_1.compoundComponentDefFromSource)(COMP, componentSource),
|
|
80
|
-
metadata: exports.FormSectionMd,
|
|
81
|
-
};
|
|
56
|
+
exports.formSectionRenderer = (0, renderers_1.createUserDefinedComponentRenderer)(exports.FormSectionMd, FormSection_xmlui_1.default);
|
|
@@ -16,5 +16,9 @@ exports.FragmentMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
exports.fragmentComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.FragmentMd, ({ node, extractValue, renderChild, layoutContext }) => {
|
|
19
|
-
|
|
19
|
+
let renderedChild = renderChild(node.children, layoutContext);
|
|
20
|
+
if (Array.isArray(renderedChild)) {
|
|
21
|
+
return (0, jsx_runtime_1.jsx)(react_1.Fragment, { children: renderedChild }, extractValue(node.uid));
|
|
22
|
+
}
|
|
23
|
+
return renderedChild;
|
|
20
24
|
});
|
|
@@ -0,0 +1,50 @@
|
|
|
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 fixtures_1 = require("../../testing/fixtures");
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// BASIC FUNCTIONALITY TESTS
|
|
15
|
+
// =============================================================================
|
|
16
|
+
fixtures_1.test.describe("Basic Functionality", () => {
|
|
17
|
+
(0, fixtures_1.test)("parent has items", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
18
|
+
const expectedChildCount = 3;
|
|
19
|
+
const expectedChildrenDisplay = ["Item #1", "Item #2", "Item #3"];
|
|
20
|
+
yield initTestBed(`
|
|
21
|
+
<Stack testId="container">
|
|
22
|
+
<Fragment>
|
|
23
|
+
<Text value='Item #1' />
|
|
24
|
+
<Text value='Item #2' />
|
|
25
|
+
<Text value='Item #3' />
|
|
26
|
+
</Fragment>
|
|
27
|
+
</Stack>`);
|
|
28
|
+
const children = page.locator(`[data-testid="container"] > *`);
|
|
29
|
+
yield (0, fixtures_1.expect)(children).toHaveCount(expectedChildCount);
|
|
30
|
+
yield (0, fixtures_1.expect)(children).toHaveText(expectedChildrenDisplay);
|
|
31
|
+
}));
|
|
32
|
+
(0, fixtures_1.test)("parent style affects children", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
33
|
+
const expectedFontSize = "14px";
|
|
34
|
+
yield initTestBed(`
|
|
35
|
+
<Stack testId="container" fontSize="${expectedFontSize}">
|
|
36
|
+
<Fragment>
|
|
37
|
+
<Text value='Item #1' />
|
|
38
|
+
<Text value='Item #2' />
|
|
39
|
+
<Text value='Item #3' />
|
|
40
|
+
</Fragment>
|
|
41
|
+
</Stack>`, {
|
|
42
|
+
testThemeVars: {
|
|
43
|
+
"font-size": "16px",
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
for (const child of yield page.locator(`[data-testid="container"] > *`).all()) {
|
|
47
|
+
yield (0, fixtures_1.expect)(child).toHaveCSS("font-size", expectedFontSize);
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
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 fixtures_1 = require("../../testing/fixtures");
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// BASIC FUNCTIONALITY TESTS
|
|
15
|
+
// =============================================================================
|
|
16
|
+
fixtures_1.test.describe("Basic Functionality", () => {
|
|
17
|
+
(0, fixtures_1.test)("renders as h1 level heading", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
18
|
+
yield initTestBed(`<H1 testId="h1">Test Heading</H1>`);
|
|
19
|
+
const driver = yield createHeadingDriver("h1");
|
|
20
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
21
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Test Heading");
|
|
22
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
23
|
+
// Verify it renders as h1 HTML element
|
|
24
|
+
const tagName = yield driver.getComponentTagName();
|
|
25
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h1");
|
|
26
|
+
}));
|
|
27
|
+
(0, fixtures_1.test)("renders with value property", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
28
|
+
yield initTestBed(`<H1 testId="h1" value="Value Property Text" />`);
|
|
29
|
+
const driver = yield createHeadingDriver("h1");
|
|
30
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
31
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Value Property Text");
|
|
32
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
33
|
+
// Verify it renders as h1 HTML element
|
|
34
|
+
const tagName = yield driver.getComponentTagName();
|
|
35
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h1");
|
|
36
|
+
}));
|
|
37
|
+
(0, fixtures_1.test)("is equivalent to Heading with level='h1'", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
38
|
+
yield initTestBed(`
|
|
39
|
+
<Fragment>
|
|
40
|
+
<Heading testId="heading" level="h1">Heading Content</Heading>
|
|
41
|
+
<H1 testId="h1">H1 Content</H1>
|
|
42
|
+
</Fragment>
|
|
43
|
+
`);
|
|
44
|
+
const headingDriver = yield createHeadingDriver("heading");
|
|
45
|
+
const h1Driver = yield createHeadingDriver("h1");
|
|
46
|
+
// Both should render as h1 elements
|
|
47
|
+
const headingTagName = yield headingDriver.getComponentTagName();
|
|
48
|
+
const h1TagName = yield h1Driver.getComponentTagName();
|
|
49
|
+
(0, fixtures_1.expect)(headingTagName.toLowerCase()).toBe("h1");
|
|
50
|
+
(0, fixtures_1.expect)(h1TagName.toLowerCase()).toBe("h1");
|
|
51
|
+
(0, fixtures_1.expect)(headingTagName).toEqual(h1TagName);
|
|
52
|
+
// Both should have heading role
|
|
53
|
+
yield (0, fixtures_1.expect)(headingDriver.component).toHaveRole("heading");
|
|
54
|
+
yield (0, fixtures_1.expect)(h1Driver.component).toHaveRole("heading");
|
|
55
|
+
}));
|
|
56
|
+
(0, fixtures_1.test)("ignores level property when provided", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
57
|
+
yield initTestBed(`<H1 testId="h1" level="h3">Should be H1</H1>`);
|
|
58
|
+
const driver = yield createHeadingDriver("h1");
|
|
59
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
60
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Should be H1");
|
|
61
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
62
|
+
// Should always be h1 despite level="h3" prop (this is the expected behavior)
|
|
63
|
+
const tagName = yield driver.getComponentTagName();
|
|
64
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h1");
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
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 fixtures_1 = require("../../testing/fixtures");
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// BASIC FUNCTIONALITY TESTS
|
|
15
|
+
// =============================================================================
|
|
16
|
+
fixtures_1.test.describe("Basic Functionality", () => {
|
|
17
|
+
(0, fixtures_1.test)("renders as h2 level heading", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
18
|
+
yield initTestBed(`<H2 testId="h2">Test Heading</H2>`);
|
|
19
|
+
const driver = yield createHeadingDriver("h2");
|
|
20
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
21
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Test Heading");
|
|
22
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
23
|
+
// Verify it renders as h2 HTML element
|
|
24
|
+
const tagName = yield driver.getComponentTagName();
|
|
25
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h2");
|
|
26
|
+
}));
|
|
27
|
+
(0, fixtures_1.test)("renders with value property", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
28
|
+
yield initTestBed(`<H2 testId="h2" value="Value Property Text" />`);
|
|
29
|
+
const driver = yield createHeadingDriver("h2");
|
|
30
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
31
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Value Property Text");
|
|
32
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
33
|
+
// Verify it renders as h2 HTML element
|
|
34
|
+
const tagName = yield driver.getComponentTagName();
|
|
35
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h2");
|
|
36
|
+
}));
|
|
37
|
+
(0, fixtures_1.test)("is equivalent to Heading with level='h2'", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
38
|
+
yield initTestBed(`
|
|
39
|
+
<Fragment>
|
|
40
|
+
<Heading testId="heading" level="h2">Heading Content</Heading>
|
|
41
|
+
<H2 testId="h2">H2 Content</H2>
|
|
42
|
+
</Fragment>
|
|
43
|
+
`);
|
|
44
|
+
const headingDriver = yield createHeadingDriver("heading");
|
|
45
|
+
const h2Driver = yield createHeadingDriver("h2");
|
|
46
|
+
// Both should render as h2 elements
|
|
47
|
+
const headingTagName = yield headingDriver.getComponentTagName();
|
|
48
|
+
const h2TagName = yield h2Driver.getComponentTagName();
|
|
49
|
+
(0, fixtures_1.expect)(headingTagName.toLowerCase()).toBe("h2");
|
|
50
|
+
(0, fixtures_1.expect)(h2TagName.toLowerCase()).toBe("h2");
|
|
51
|
+
(0, fixtures_1.expect)(headingTagName).toEqual(h2TagName);
|
|
52
|
+
// Both should have heading role
|
|
53
|
+
yield (0, fixtures_1.expect)(headingDriver.component).toHaveRole("heading");
|
|
54
|
+
yield (0, fixtures_1.expect)(h2Driver.component).toHaveRole("heading");
|
|
55
|
+
}));
|
|
56
|
+
(0, fixtures_1.test)("ignores level property when provided", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
57
|
+
yield initTestBed(`<H2 testId="h2" level="h4">Should be H2</H2>`);
|
|
58
|
+
const driver = yield createHeadingDriver("h2");
|
|
59
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
60
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Should be H2");
|
|
61
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
62
|
+
// Should always be h2 despite level="h4" prop (this is the expected behavior)
|
|
63
|
+
const tagName = yield driver.getComponentTagName();
|
|
64
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h2");
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
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 fixtures_1 = require("../../testing/fixtures");
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// BASIC FUNCTIONALITY TESTS
|
|
15
|
+
// =============================================================================
|
|
16
|
+
fixtures_1.test.describe("Basic Functionality", () => {
|
|
17
|
+
(0, fixtures_1.test)("renders as h3 level heading", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
18
|
+
yield initTestBed(`<H3 testId="h3">Test Heading</H3>`);
|
|
19
|
+
const driver = yield createHeadingDriver("h3");
|
|
20
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
21
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Test Heading");
|
|
22
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
23
|
+
// Verify it renders as h3 HTML element
|
|
24
|
+
const tagName = yield driver.getComponentTagName();
|
|
25
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h3");
|
|
26
|
+
}));
|
|
27
|
+
(0, fixtures_1.test)("renders with value property", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
28
|
+
yield initTestBed(`<H3 testId="h3" value="Value Property Text" />`);
|
|
29
|
+
const driver = yield createHeadingDriver("h3");
|
|
30
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
31
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Value Property Text");
|
|
32
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
33
|
+
// Verify it renders as h3 HTML element
|
|
34
|
+
const tagName = yield driver.getComponentTagName();
|
|
35
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h3");
|
|
36
|
+
}));
|
|
37
|
+
(0, fixtures_1.test)("is equivalent to Heading with level='h3'", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
38
|
+
yield initTestBed(`
|
|
39
|
+
<Fragment>
|
|
40
|
+
<Heading testId="heading" level="h3">Heading Content</Heading>
|
|
41
|
+
<H3 testId="h3">H3 Content</H3>
|
|
42
|
+
</Fragment>
|
|
43
|
+
`);
|
|
44
|
+
const headingDriver = yield createHeadingDriver("heading");
|
|
45
|
+
const h3Driver = yield createHeadingDriver("h3");
|
|
46
|
+
// Both should render as h3 elements
|
|
47
|
+
const headingTagName = yield headingDriver.getComponentTagName();
|
|
48
|
+
const h3TagName = yield h3Driver.getComponentTagName();
|
|
49
|
+
(0, fixtures_1.expect)(headingTagName.toLowerCase()).toBe("h3");
|
|
50
|
+
(0, fixtures_1.expect)(h3TagName.toLowerCase()).toBe("h3");
|
|
51
|
+
(0, fixtures_1.expect)(headingTagName).toEqual(h3TagName);
|
|
52
|
+
// Both should have heading role
|
|
53
|
+
yield (0, fixtures_1.expect)(headingDriver.component).toHaveRole("heading");
|
|
54
|
+
yield (0, fixtures_1.expect)(h3Driver.component).toHaveRole("heading");
|
|
55
|
+
}));
|
|
56
|
+
(0, fixtures_1.test)("ignores level property when provided", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
57
|
+
yield initTestBed(`<H3 testId="h3" level="h1">Should be H3</H3>`);
|
|
58
|
+
const driver = yield createHeadingDriver("h3");
|
|
59
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
60
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Should be H3");
|
|
61
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
62
|
+
// Should always be h3 despite level="h1" prop (this is the expected behavior)
|
|
63
|
+
const tagName = yield driver.getComponentTagName();
|
|
64
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h3");
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
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 fixtures_1 = require("../../testing/fixtures");
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// BASIC FUNCTIONALITY TESTS
|
|
15
|
+
// =============================================================================
|
|
16
|
+
fixtures_1.test.describe("Basic Functionality", () => {
|
|
17
|
+
(0, fixtures_1.test)("renders as h4 level heading", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
18
|
+
yield initTestBed(`<H4 testId="h4">Test Heading</H4>`);
|
|
19
|
+
const driver = yield createHeadingDriver("h4");
|
|
20
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
21
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Test Heading");
|
|
22
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
23
|
+
// Verify it renders as h4 HTML element
|
|
24
|
+
const tagName = yield driver.getComponentTagName();
|
|
25
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h4");
|
|
26
|
+
}));
|
|
27
|
+
(0, fixtures_1.test)("renders with value property", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
28
|
+
yield initTestBed(`<H4 testId="h4" value="Value Property Text" />`);
|
|
29
|
+
const driver = yield createHeadingDriver("h4");
|
|
30
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
31
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Value Property Text");
|
|
32
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
33
|
+
// Verify it renders as h4 HTML element
|
|
34
|
+
const tagName = yield driver.getComponentTagName();
|
|
35
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h4");
|
|
36
|
+
}));
|
|
37
|
+
(0, fixtures_1.test)("is equivalent to Heading with level='h4'", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
38
|
+
yield initTestBed(`
|
|
39
|
+
<Fragment>
|
|
40
|
+
<Heading testId="heading" level="h4">Heading Content</Heading>
|
|
41
|
+
<H4 testId="h4">H4 Content</H4>
|
|
42
|
+
</Fragment>
|
|
43
|
+
`);
|
|
44
|
+
const headingDriver = yield createHeadingDriver("heading");
|
|
45
|
+
const h4Driver = yield createHeadingDriver("h4");
|
|
46
|
+
// Both should render as h4 elements
|
|
47
|
+
const headingTagName = yield headingDriver.getComponentTagName();
|
|
48
|
+
const h4TagName = yield h4Driver.getComponentTagName();
|
|
49
|
+
(0, fixtures_1.expect)(headingTagName.toLowerCase()).toBe("h4");
|
|
50
|
+
(0, fixtures_1.expect)(h4TagName.toLowerCase()).toBe("h4");
|
|
51
|
+
(0, fixtures_1.expect)(headingTagName).toEqual(h4TagName);
|
|
52
|
+
// Both should have heading role
|
|
53
|
+
yield (0, fixtures_1.expect)(headingDriver.component).toHaveRole("heading");
|
|
54
|
+
yield (0, fixtures_1.expect)(h4Driver.component).toHaveRole("heading");
|
|
55
|
+
}));
|
|
56
|
+
(0, fixtures_1.test)("ignores level property when provided", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
57
|
+
yield initTestBed(`<H4 testId="h4" level="h1">Should be H4</H4>`);
|
|
58
|
+
const driver = yield createHeadingDriver("h4");
|
|
59
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
60
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Should be H4");
|
|
61
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
62
|
+
// Should always be h4 despite level="h1" prop (this is the expected behavior)
|
|
63
|
+
const tagName = yield driver.getComponentTagName();
|
|
64
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h4");
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
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 fixtures_1 = require("../../testing/fixtures");
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// BASIC FUNCTIONALITY TESTS
|
|
15
|
+
// =============================================================================
|
|
16
|
+
fixtures_1.test.describe("Basic Functionality", () => {
|
|
17
|
+
(0, fixtures_1.test)("renders as h5 level heading", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
18
|
+
yield initTestBed(`<H5 testId="h5">Test Heading</H5>`);
|
|
19
|
+
const driver = yield createHeadingDriver("h5");
|
|
20
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
21
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Test Heading");
|
|
22
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
23
|
+
// Verify it renders as h5 HTML element
|
|
24
|
+
const tagName = yield driver.getComponentTagName();
|
|
25
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h5");
|
|
26
|
+
}));
|
|
27
|
+
(0, fixtures_1.test)("renders with value property", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
28
|
+
yield initTestBed(`<H5 testId="h5" value="Value Property Text" />`);
|
|
29
|
+
const driver = yield createHeadingDriver("h5");
|
|
30
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
31
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Value Property Text");
|
|
32
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
33
|
+
// Verify it renders as h5 HTML element
|
|
34
|
+
const tagName = yield driver.getComponentTagName();
|
|
35
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h5");
|
|
36
|
+
}));
|
|
37
|
+
(0, fixtures_1.test)("is equivalent to Heading with level='h5'", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
38
|
+
yield initTestBed(`
|
|
39
|
+
<Fragment>
|
|
40
|
+
<Heading testId="heading" level="h5">Heading Content</Heading>
|
|
41
|
+
<H5 testId="h5">H5 Content</H5>
|
|
42
|
+
</Fragment>
|
|
43
|
+
`);
|
|
44
|
+
const headingDriver = yield createHeadingDriver("heading");
|
|
45
|
+
const h5Driver = yield createHeadingDriver("h5");
|
|
46
|
+
// Both should render as h5 elements
|
|
47
|
+
const headingTagName = yield headingDriver.getComponentTagName();
|
|
48
|
+
const h5TagName = yield h5Driver.getComponentTagName();
|
|
49
|
+
(0, fixtures_1.expect)(headingTagName.toLowerCase()).toBe("h5");
|
|
50
|
+
(0, fixtures_1.expect)(h5TagName.toLowerCase()).toBe("h5");
|
|
51
|
+
(0, fixtures_1.expect)(headingTagName).toEqual(h5TagName);
|
|
52
|
+
// Both should have heading role
|
|
53
|
+
yield (0, fixtures_1.expect)(headingDriver.component).toHaveRole("heading");
|
|
54
|
+
yield (0, fixtures_1.expect)(h5Driver.component).toHaveRole("heading");
|
|
55
|
+
}));
|
|
56
|
+
(0, fixtures_1.test)("ignores level property when provided", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
57
|
+
yield initTestBed(`<H5 testId="h5" level="h1">Should be H5</H5>`);
|
|
58
|
+
const driver = yield createHeadingDriver("h5");
|
|
59
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
60
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Should be H5");
|
|
61
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
62
|
+
// Should always be h5 despite level="h1" prop (this is the expected behavior)
|
|
63
|
+
const tagName = yield driver.getComponentTagName();
|
|
64
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h5");
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
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 fixtures_1 = require("../../testing/fixtures");
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// BASIC FUNCTIONALITY TESTS
|
|
15
|
+
// =============================================================================
|
|
16
|
+
fixtures_1.test.describe("Basic Functionality", () => {
|
|
17
|
+
(0, fixtures_1.test)("renders as h6 level heading", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
18
|
+
yield initTestBed(`<H6 testId="h6">Test Heading</H6>`);
|
|
19
|
+
const driver = yield createHeadingDriver("h6");
|
|
20
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
21
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Test Heading");
|
|
22
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
23
|
+
// Verify it renders as h6 HTML element
|
|
24
|
+
const tagName = yield driver.getComponentTagName();
|
|
25
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h6");
|
|
26
|
+
}));
|
|
27
|
+
(0, fixtures_1.test)("renders with value property", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
28
|
+
yield initTestBed(`<H6 testId="h6" value="Value Property Text" />`);
|
|
29
|
+
const driver = yield createHeadingDriver("h6");
|
|
30
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
31
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Value Property Text");
|
|
32
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
33
|
+
// Verify it renders as h6 HTML element
|
|
34
|
+
const tagName = yield driver.getComponentTagName();
|
|
35
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h6");
|
|
36
|
+
}));
|
|
37
|
+
(0, fixtures_1.test)("is equivalent to Heading with level='h6'", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
38
|
+
yield initTestBed(`
|
|
39
|
+
<Fragment>
|
|
40
|
+
<Heading testId="heading" level="h6">Heading Content</Heading>
|
|
41
|
+
<H6 testId="h6">H6 Content</H6>
|
|
42
|
+
</Fragment>
|
|
43
|
+
`);
|
|
44
|
+
const headingDriver = yield createHeadingDriver("heading");
|
|
45
|
+
const h6Driver = yield createHeadingDriver("h6");
|
|
46
|
+
// Both should render as h6 elements
|
|
47
|
+
const headingTagName = yield headingDriver.getComponentTagName();
|
|
48
|
+
const h6TagName = yield h6Driver.getComponentTagName();
|
|
49
|
+
(0, fixtures_1.expect)(headingTagName.toLowerCase()).toBe("h6");
|
|
50
|
+
(0, fixtures_1.expect)(h6TagName.toLowerCase()).toBe("h6");
|
|
51
|
+
(0, fixtures_1.expect)(headingTagName).toEqual(h6TagName);
|
|
52
|
+
// Both should have heading role
|
|
53
|
+
yield (0, fixtures_1.expect)(headingDriver.component).toHaveRole("heading");
|
|
54
|
+
yield (0, fixtures_1.expect)(h6Driver.component).toHaveRole("heading");
|
|
55
|
+
}));
|
|
56
|
+
(0, fixtures_1.test)("ignores level property when provided", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createHeadingDriver }) {
|
|
57
|
+
yield initTestBed(`<H6 testId="h6" level="h1">Should be H6</H6>`);
|
|
58
|
+
const driver = yield createHeadingDriver("h6");
|
|
59
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
60
|
+
yield (0, fixtures_1.expect)(driver.component).toContainText("Should be H6");
|
|
61
|
+
yield (0, fixtures_1.expect)(driver.component).toHaveRole("heading");
|
|
62
|
+
// Should always be h6 despite level="h1" prop (this is the expected behavior)
|
|
63
|
+
const tagName = yield driver.getComponentTagName();
|
|
64
|
+
(0, fixtures_1.expect)(tagName.toLowerCase()).toBe("h6");
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
@@ -114,11 +114,9 @@ exports.H1Md = (0, metadata_helpers_1.createMetadata)({
|
|
|
114
114
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
115
115
|
defaultThemeVars: {
|
|
116
116
|
[`fontSize-${H1}`]: "$fontSize-2xl",
|
|
117
|
-
[`lineHeight-${H1}`]: "$lineHeight-2xl",
|
|
118
117
|
[`marginTop-${H1}`]: "0",
|
|
119
118
|
[`marginBottom-${H1}`]: "0",
|
|
120
119
|
[`fontSize-${H1}-markdown`]: "$fontSize-2xl",
|
|
121
|
-
[`lineHeight-${H1}-markdown`]: "$lineHeight-2xl",
|
|
122
120
|
[`marginTop-${H1}-markdown`]: "0",
|
|
123
121
|
[`marginBottom-${H1}-markdown`]: "$space-6",
|
|
124
122
|
light: {
|
|
@@ -146,11 +144,9 @@ exports.H2Md = (0, metadata_helpers_1.createMetadata)({
|
|
|
146
144
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
147
145
|
defaultThemeVars: {
|
|
148
146
|
[`fontSize-${H2}`]: "$fontSize-xl",
|
|
149
|
-
[`lineHeight-${H2}`]: "$lineHeight-xl",
|
|
150
147
|
[`marginTop-${H2}`]: "0",
|
|
151
148
|
[`marginBottom-${H2}`]: "0",
|
|
152
149
|
[`fontSize-${H2}-markdown`]: "$fontSize-xl",
|
|
153
|
-
[`lineHeight-${H2}-markdown`]: "$lineHeight-xl",
|
|
154
150
|
[`marginTop-${H2}-markdown`]: "$space-10",
|
|
155
151
|
[`marginBottom-${H2}-markdown`]: "$space-3",
|
|
156
152
|
light: {
|
|
@@ -178,11 +174,9 @@ exports.H3Md = (0, metadata_helpers_1.createMetadata)({
|
|
|
178
174
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
179
175
|
defaultThemeVars: {
|
|
180
176
|
[`fontSize-${H3}`]: "$fontSize-lg",
|
|
181
|
-
[`lineHeight-${H3}`]: "$lineHeight-lg",
|
|
182
177
|
[`marginTop-${H3}`]: "0",
|
|
183
178
|
[`marginBottom-${H3}`]: "0",
|
|
184
179
|
[`fontSize-${H3}-markdown`]: "$fontSize-lg",
|
|
185
|
-
[`lineHeight-${H3}-markdown`]: "$lineHeight-lg",
|
|
186
180
|
[`marginTop-${H3}-markdown`]: "$space-6",
|
|
187
181
|
[`marginBottom-${H3}-markdown`]: "$space-2",
|
|
188
182
|
light: {
|
|
@@ -210,11 +204,9 @@ exports.H4Md = (0, metadata_helpers_1.createMetadata)({
|
|
|
210
204
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
211
205
|
defaultThemeVars: {
|
|
212
206
|
[`fontSize-${H4}`]: "$fontSize-base",
|
|
213
|
-
[`lineHeight-${H4}`]: "$lineHeight-base",
|
|
214
207
|
[`marginTop-${H4}`]: "0",
|
|
215
208
|
[`marginBottom-${H4}`]: "0",
|
|
216
209
|
[`fontSize-${H4}-markdown`]: "$fontSize-base",
|
|
217
|
-
[`lineHeight-${H4}-markdown`]: "$lineHeight-base",
|
|
218
210
|
[`marginTop-${H4}-markdown`]: "$space-5",
|
|
219
211
|
[`marginBottom-${H4}-markdown`]: "$space-1",
|
|
220
212
|
light: {
|
|
@@ -242,11 +234,9 @@ exports.H5Md = (0, metadata_helpers_1.createMetadata)({
|
|
|
242
234
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
243
235
|
defaultThemeVars: {
|
|
244
236
|
[`fontSize-${H5}`]: "$fontSize-sm",
|
|
245
|
-
[`lineHeight-${H5}`]: "$lineHeight-sm",
|
|
246
237
|
[`marginTop-${H5}`]: "0",
|
|
247
238
|
[`marginBottom-${H5}`]: "0",
|
|
248
239
|
[`fontSize-${H5}-markdown`]: "$fontSize-sm",
|
|
249
|
-
[`lineHeight-${H5}-markdown`]: "$lineHeight-sm",
|
|
250
240
|
[`marginTop-${H5}-markdown`]: "0",
|
|
251
241
|
[`marginBottom-${H5}-markdown`]: "$space-0",
|
|
252
242
|
light: {
|
|
@@ -274,11 +264,9 @@ exports.H6Md = (0, metadata_helpers_1.createMetadata)({
|
|
|
274
264
|
themeVars: (0, themeVars_1.parseScssVar)(Heading_module_scss_1.default.themeVars),
|
|
275
265
|
defaultThemeVars: {
|
|
276
266
|
[`fontSize-${H6}`]: "$fontSize-xs",
|
|
277
|
-
[`lineHeight-${H6}`]: "$lineHeight-xs",
|
|
278
267
|
[`marginTop-${H6}`]: "0",
|
|
279
268
|
[`marginBottom-${H6}`]: "0",
|
|
280
269
|
[`fontSize-${H6}-markdown`]: "$fontSize-xs",
|
|
281
|
-
[`lineHeight-${H6}-markdown`]: "$lineHeight-xs",
|
|
282
270
|
[`marginTop-${H6}-markdown`]: "0",
|
|
283
271
|
[`marginBottom-${H6}-markdown`]: "$space-0",
|
|
284
272
|
light: {
|