@morscherlab/mld-sdk 0.6.0
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/README.md +326 -0
- package/dist/__tests__/components/AppLayout.test.d.ts +1 -0
- package/dist/__tests__/components/AppSidebar.test.d.ts +1 -0
- package/dist/__tests__/components/AppTopBar.test.d.ts +1 -0
- package/dist/__tests__/components/BaseInput.test.d.ts +1 -0
- package/dist/__tests__/components/BasePill.test.d.ts +1 -0
- package/dist/__tests__/components/Calendar.test.d.ts +1 -0
- package/dist/__tests__/components/CollapsibleCard.test.d.ts +1 -0
- package/dist/__tests__/components/DataFrame.test.d.ts +1 -0
- package/dist/__tests__/components/DropdownButton.test.d.ts +1 -0
- package/dist/__tests__/composables/useAuth.test.d.ts +1 -0
- package/dist/__tests__/composables/useForm.test.d.ts +1 -0
- package/dist/components/AlertBox.vue.d.ts +30 -0
- package/dist/components/AlertBox.vue.js +125 -0
- package/dist/components/AlertBox.vue.js.map +1 -0
- package/dist/components/AlertBox.vue3.js +6 -0
- package/dist/components/AlertBox.vue3.js.map +1 -0
- package/dist/components/AppContainer.vue.d.ts +28 -0
- package/dist/components/AppContainer.vue.js +28 -0
- package/dist/components/AppContainer.vue.js.map +1 -0
- package/dist/components/AppContainer.vue2.js +5 -0
- package/dist/components/AppContainer.vue2.js.map +1 -0
- package/dist/components/AppLayout.vue.d.ts +31 -0
- package/dist/components/AppLayout.vue.js +51 -0
- package/dist/components/AppLayout.vue.js.map +1 -0
- package/dist/components/AppLayout.vue3.js +6 -0
- package/dist/components/AppLayout.vue3.js.map +1 -0
- package/dist/components/AppSidebar.vue.d.ts +44 -0
- package/dist/components/AppSidebar.vue.js +79 -0
- package/dist/components/AppSidebar.vue.js.map +1 -0
- package/dist/components/AppSidebar.vue3.js +6 -0
- package/dist/components/AppSidebar.vue3.js.map +1 -0
- package/dist/components/AppTopBar.vue.d.ts +77 -0
- package/dist/components/AppTopBar.vue.js +564 -0
- package/dist/components/AppTopBar.vue.js.map +1 -0
- package/dist/components/AppTopBar.vue3.js +6 -0
- package/dist/components/AppTopBar.vue3.js.map +1 -0
- package/dist/components/AuditTrail.vue.d.ts +47 -0
- package/dist/components/AuditTrail.vue.js +189 -0
- package/dist/components/AuditTrail.vue.js.map +1 -0
- package/dist/components/AuditTrail.vue3.js +6 -0
- package/dist/components/AuditTrail.vue3.js.map +1 -0
- package/dist/components/Avatar.vue.d.ts +13 -0
- package/dist/components/Avatar.vue.js +64 -0
- package/dist/components/Avatar.vue.js.map +1 -0
- package/dist/components/Avatar.vue3.js +6 -0
- package/dist/components/Avatar.vue3.js.map +1 -0
- package/dist/components/BaseButton.vue.d.ts +37 -0
- package/dist/components/BaseButton.vue.js +64 -0
- package/dist/components/BaseButton.vue.js.map +1 -0
- package/dist/components/BaseButton.vue3.js +6 -0
- package/dist/components/BaseButton.vue3.js.map +1 -0
- package/dist/components/BaseCheckbox.vue.d.ts +16 -0
- package/dist/components/BaseCheckbox.vue.js +71 -0
- package/dist/components/BaseCheckbox.vue.js.map +1 -0
- package/dist/components/BaseCheckbox.vue3.js +6 -0
- package/dist/components/BaseCheckbox.vue3.js.map +1 -0
- package/dist/components/BaseInput.vue.d.ts +33 -0
- package/dist/components/BaseInput.vue.js +57 -0
- package/dist/components/BaseInput.vue.js.map +1 -0
- package/dist/components/BaseInput.vue3.js +6 -0
- package/dist/components/BaseInput.vue3.js.map +1 -0
- package/dist/components/BaseModal.vue.d.ts +38 -0
- package/dist/components/BaseModal.vue.js +118 -0
- package/dist/components/BaseModal.vue.js.map +1 -0
- package/dist/components/BaseModal.vue3.js +6 -0
- package/dist/components/BaseModal.vue3.js.map +1 -0
- package/dist/components/BasePill.vue.d.ts +54 -0
- package/dist/components/BasePill.vue.js +68 -0
- package/dist/components/BasePill.vue.js.map +1 -0
- package/dist/components/BasePill.vue3.js +6 -0
- package/dist/components/BasePill.vue3.js.map +1 -0
- package/dist/components/BaseRadioGroup.vue.d.ts +19 -0
- package/dist/components/BaseRadioGroup.vue.js +80 -0
- package/dist/components/BaseRadioGroup.vue.js.map +1 -0
- package/dist/components/BaseRadioGroup.vue3.js +6 -0
- package/dist/components/BaseRadioGroup.vue3.js.map +1 -0
- package/dist/components/BaseSelect.vue.d.ts +19 -0
- package/dist/components/BaseSelect.vue.js +70 -0
- package/dist/components/BaseSelect.vue.js.map +1 -0
- package/dist/components/BaseSelect.vue3.js +6 -0
- package/dist/components/BaseSelect.vue3.js.map +1 -0
- package/dist/components/BaseSlider.vue.d.ts +22 -0
- package/dist/components/BaseSlider.vue.js +97 -0
- package/dist/components/BaseSlider.vue.js.map +1 -0
- package/dist/components/BaseSlider.vue3.js +6 -0
- package/dist/components/BaseSlider.vue3.js.map +1 -0
- package/dist/components/BaseTabs.vue.d.ts +14 -0
- package/dist/components/BaseTabs.vue.js +63 -0
- package/dist/components/BaseTabs.vue.js.map +1 -0
- package/dist/components/BaseTabs.vue3.js +6 -0
- package/dist/components/BaseTabs.vue3.js.map +1 -0
- package/dist/components/BaseTextarea.vue.d.ts +28 -0
- package/dist/components/BaseTextarea.vue.js +49 -0
- package/dist/components/BaseTextarea.vue.js.map +1 -0
- package/dist/components/BaseTextarea.vue3.js +6 -0
- package/dist/components/BaseTextarea.vue3.js.map +1 -0
- package/dist/components/BaseToggle.vue.d.ts +16 -0
- package/dist/components/BaseToggle.vue.js +65 -0
- package/dist/components/BaseToggle.vue.js.map +1 -0
- package/dist/components/BaseToggle.vue3.js +6 -0
- package/dist/components/BaseToggle.vue3.js.map +1 -0
- package/dist/components/BatchProgressList.vue.d.ts +59 -0
- package/dist/components/BatchProgressList.vue.js +250 -0
- package/dist/components/BatchProgressList.vue.js.map +1 -0
- package/dist/components/BatchProgressList.vue3.js +6 -0
- package/dist/components/BatchProgressList.vue3.js.map +1 -0
- package/dist/components/Breadcrumb.vue.d.ts +37 -0
- package/dist/components/Breadcrumb.vue.js +71 -0
- package/dist/components/Breadcrumb.vue.js.map +1 -0
- package/dist/components/Breadcrumb.vue3.js +6 -0
- package/dist/components/Breadcrumb.vue3.js.map +1 -0
- package/dist/components/Calendar.vue.d.ts +107 -0
- package/dist/components/Calendar.vue.js +328 -0
- package/dist/components/Calendar.vue.js.map +1 -0
- package/dist/components/Calendar.vue3.js +6 -0
- package/dist/components/Calendar.vue3.js.map +1 -0
- package/dist/components/ChartContainer.vue.d.ts +31 -0
- package/dist/components/ChartContainer.vue.js +78 -0
- package/dist/components/ChartContainer.vue.js.map +1 -0
- package/dist/components/ChartContainer.vue3.js +6 -0
- package/dist/components/ChartContainer.vue3.js.map +1 -0
- package/dist/components/ChemicalFormula.vue.d.ts +8 -0
- package/dist/components/ChemicalFormula.vue.js +57 -0
- package/dist/components/ChemicalFormula.vue.js.map +1 -0
- package/dist/components/ChemicalFormula.vue3.js +6 -0
- package/dist/components/ChemicalFormula.vue3.js.map +1 -0
- package/dist/components/CollapsibleCard.vue.d.ts +39 -0
- package/dist/components/CollapsibleCard.vue.js +175 -0
- package/dist/components/CollapsibleCard.vue.js.map +1 -0
- package/dist/components/CollapsibleCard.vue3.js +6 -0
- package/dist/components/CollapsibleCard.vue3.js.map +1 -0
- package/dist/components/ColorSlider.vue.d.ts +34 -0
- package/dist/components/ColorSlider.vue.js +131 -0
- package/dist/components/ColorSlider.vue.js.map +1 -0
- package/dist/components/ColorSlider.vue3.js +6 -0
- package/dist/components/ColorSlider.vue3.js.map +1 -0
- package/dist/components/ConcentrationInput.vue.d.ts +25 -0
- package/dist/components/ConcentrationInput.vue.js +161 -0
- package/dist/components/ConcentrationInput.vue.js.map +1 -0
- package/dist/components/ConcentrationInput.vue3.js +6 -0
- package/dist/components/ConcentrationInput.vue3.js.map +1 -0
- package/dist/components/ConfirmDialog.vue.d.ts +41 -0
- package/dist/components/ConfirmDialog.vue.js +140 -0
- package/dist/components/ConfirmDialog.vue.js.map +1 -0
- package/dist/components/ConfirmDialog.vue3.js +6 -0
- package/dist/components/ConfirmDialog.vue3.js.map +1 -0
- package/dist/components/DataFrame.vue.d.ts +107 -0
- package/dist/components/DataFrame.vue.js +430 -0
- package/dist/components/DataFrame.vue.js.map +1 -0
- package/dist/components/DataFrame.vue3.js +6 -0
- package/dist/components/DataFrame.vue3.js.map +1 -0
- package/dist/components/DatePicker.vue.d.ts +23 -0
- package/dist/components/DatePicker.vue.js +278 -0
- package/dist/components/DatePicker.vue.js.map +1 -0
- package/dist/components/DatePicker.vue3.js +6 -0
- package/dist/components/DatePicker.vue3.js.map +1 -0
- package/dist/components/DateTimePicker.vue.d.ts +30 -0
- package/dist/components/DateTimePicker.vue.js +413 -0
- package/dist/components/DateTimePicker.vue.js.map +1 -0
- package/dist/components/DateTimePicker.vue3.js +6 -0
- package/dist/components/DateTimePicker.vue3.js.map +1 -0
- package/dist/components/Divider.vue.d.ts +11 -0
- package/dist/components/Divider.vue.js +42 -0
- package/dist/components/Divider.vue.js.map +1 -0
- package/dist/components/Divider.vue3.js +6 -0
- package/dist/components/Divider.vue3.js.map +1 -0
- package/dist/components/DoseCalculator.vue.d.ts +19 -0
- package/dist/components/DoseCalculator.vue.js +470 -0
- package/dist/components/DoseCalculator.vue.js.map +1 -0
- package/dist/components/DoseCalculator.vue3.js +6 -0
- package/dist/components/DoseCalculator.vue3.js.map +1 -0
- package/dist/components/DropdownButton.vue.d.ts +47 -0
- package/dist/components/DropdownButton.vue.js +171 -0
- package/dist/components/DropdownButton.vue.js.map +1 -0
- package/dist/components/DropdownButton.vue3.js +6 -0
- package/dist/components/DropdownButton.vue3.js.map +1 -0
- package/dist/components/EmptyState.vue.d.ts +33 -0
- package/dist/components/EmptyState.vue.js +80 -0
- package/dist/components/EmptyState.vue.js.map +1 -0
- package/dist/components/EmptyState.vue3.js +6 -0
- package/dist/components/EmptyState.vue3.js.map +1 -0
- package/dist/components/ExperimentTimeline.vue.d.ts +44 -0
- package/dist/components/ExperimentTimeline.vue.js +395 -0
- package/dist/components/ExperimentTimeline.vue.js.map +1 -0
- package/dist/components/ExperimentTimeline.vue3.js +6 -0
- package/dist/components/ExperimentTimeline.vue3.js.map +1 -0
- package/dist/components/FileUploader.vue.d.ts +23 -0
- package/dist/components/FileUploader.vue.js +416 -0
- package/dist/components/FileUploader.vue.js.map +1 -0
- package/dist/components/FileUploader.vue3.js +6 -0
- package/dist/components/FileUploader.vue3.js.map +1 -0
- package/dist/components/FormField.vue.d.ts +24 -0
- package/dist/components/FormField.vue.js +45 -0
- package/dist/components/FormField.vue.js.map +1 -0
- package/dist/components/FormField.vue3.js +6 -0
- package/dist/components/FormField.vue3.js.map +1 -0
- package/dist/components/FormulaInput.vue.d.ts +25 -0
- package/dist/components/FormulaInput.vue.js +121 -0
- package/dist/components/FormulaInput.vue.js.map +1 -0
- package/dist/components/FormulaInput.vue3.js +6 -0
- package/dist/components/FormulaInput.vue3.js.map +1 -0
- package/dist/components/GroupAssigner.vue.d.ts +25 -0
- package/dist/components/GroupAssigner.vue.js +311 -0
- package/dist/components/GroupAssigner.vue.js.map +1 -0
- package/dist/components/GroupAssigner.vue3.js +6 -0
- package/dist/components/GroupAssigner.vue3.js.map +1 -0
- package/dist/components/GroupingModal.vue.d.ts +12 -0
- package/dist/components/GroupingModal.vue.js +446 -0
- package/dist/components/GroupingModal.vue.js.map +1 -0
- package/dist/components/GroupingModal.vue3.js +6 -0
- package/dist/components/GroupingModal.vue3.js.map +1 -0
- package/dist/components/IconButton.vue.d.ts +34 -0
- package/dist/components/IconButton.vue.js +67 -0
- package/dist/components/IconButton.vue.js.map +1 -0
- package/dist/components/IconButton.vue3.js +6 -0
- package/dist/components/IconButton.vue3.js.map +1 -0
- package/dist/components/LoadingSpinner.vue.d.ts +11 -0
- package/dist/components/LoadingSpinner.vue.js +47 -0
- package/dist/components/LoadingSpinner.vue.js.map +1 -0
- package/dist/components/LoadingSpinner.vue3.js +6 -0
- package/dist/components/LoadingSpinner.vue3.js.map +1 -0
- package/dist/components/MoleculeInput.vue.d.ts +30 -0
- package/dist/components/MoleculeInput.vue.js +327 -0
- package/dist/components/MoleculeInput.vue.js.map +1 -0
- package/dist/components/MoleculeInput.vue3.js +6 -0
- package/dist/components/MoleculeInput.vue3.js.map +1 -0
- package/dist/components/MultiSelect.vue.d.ts +19 -0
- package/dist/components/MultiSelect.vue.js +109 -0
- package/dist/components/MultiSelect.vue.js.map +1 -0
- package/dist/components/MultiSelect.vue3.js +6 -0
- package/dist/components/MultiSelect.vue3.js.map +1 -0
- package/dist/components/NumberInput.vue.d.ts +21 -0
- package/dist/components/NumberInput.vue.js +133 -0
- package/dist/components/NumberInput.vue.js.map +1 -0
- package/dist/components/NumberInput.vue3.js +6 -0
- package/dist/components/NumberInput.vue3.js.map +1 -0
- package/dist/components/PlateMapEditor.vue.d.ts +50 -0
- package/dist/components/PlateMapEditor.vue.js +480 -0
- package/dist/components/PlateMapEditor.vue.js.map +1 -0
- package/dist/components/PlateMapEditor.vue3.js +6 -0
- package/dist/components/PlateMapEditor.vue3.js.map +1 -0
- package/dist/components/ProgressBar.vue.d.ts +17 -0
- package/dist/components/ProgressBar.vue.js +65 -0
- package/dist/components/ProgressBar.vue.js.map +1 -0
- package/dist/components/ProgressBar.vue3.js +6 -0
- package/dist/components/ProgressBar.vue3.js.map +1 -0
- package/dist/components/ProtocolStepEditor.vue.d.ts +24 -0
- package/dist/components/ProtocolStepEditor.vue.js +491 -0
- package/dist/components/ProtocolStepEditor.vue.js.map +1 -0
- package/dist/components/ProtocolStepEditor.vue3.js +6 -0
- package/dist/components/ProtocolStepEditor.vue3.js.map +1 -0
- package/dist/components/RackEditor.vue.d.ts +40 -0
- package/dist/components/RackEditor.vue.js +325 -0
- package/dist/components/RackEditor.vue.js.map +1 -0
- package/dist/components/RackEditor.vue3.js +6 -0
- package/dist/components/RackEditor.vue3.js.map +1 -0
- package/dist/components/ReagentList.vue.d.ts +46 -0
- package/dist/components/ReagentList.vue.js +526 -0
- package/dist/components/ReagentList.vue.js.map +1 -0
- package/dist/components/ReagentList.vue3.js +6 -0
- package/dist/components/ReagentList.vue3.js.map +1 -0
- package/dist/components/ResourceCard.vue.d.ts +50 -0
- package/dist/components/ResourceCard.vue.js +212 -0
- package/dist/components/ResourceCard.vue.js.map +1 -0
- package/dist/components/ResourceCard.vue3.js +6 -0
- package/dist/components/ResourceCard.vue3.js.map +1 -0
- package/dist/components/SampleHierarchyTree.vue.d.ts +37 -0
- package/dist/components/SampleHierarchyTree.vue.js +217 -0
- package/dist/components/SampleHierarchyTree.vue.js.map +1 -0
- package/dist/components/SampleHierarchyTree.vue3.js +6 -0
- package/dist/components/SampleHierarchyTree.vue3.js.map +1 -0
- package/dist/components/SampleLegend.vue.d.ts +32 -0
- package/dist/components/SampleLegend.vue.js +129 -0
- package/dist/components/SampleLegend.vue.js.map +1 -0
- package/dist/components/SampleLegend.vue3.js +6 -0
- package/dist/components/SampleLegend.vue3.js.map +1 -0
- package/dist/components/SampleSelector.vue.d.ts +29 -0
- package/dist/components/SampleSelector.vue.js +1076 -0
- package/dist/components/SampleSelector.vue.js.map +1 -0
- package/dist/components/SampleSelector.vue3.js +6 -0
- package/dist/components/SampleSelector.vue3.js.map +1 -0
- package/dist/components/ScheduleCalendar.vue.d.ts +110 -0
- package/dist/components/ScheduleCalendar.vue.js +535 -0
- package/dist/components/ScheduleCalendar.vue.js.map +1 -0
- package/dist/components/ScheduleCalendar.vue3.js +6 -0
- package/dist/components/ScheduleCalendar.vue3.js.map +1 -0
- package/dist/components/ScientificNumber.vue.d.ts +14 -0
- package/dist/components/ScientificNumber.vue.js +190 -0
- package/dist/components/ScientificNumber.vue.js.map +1 -0
- package/dist/components/ScientificNumber.vue3.js +6 -0
- package/dist/components/ScientificNumber.vue3.js.map +1 -0
- package/dist/components/SegmentedControl.vue.d.ts +20 -0
- package/dist/components/SegmentedControl.vue.js +71 -0
- package/dist/components/SegmentedControl.vue.js.map +1 -0
- package/dist/components/SegmentedControl.vue3.js +6 -0
- package/dist/components/SegmentedControl.vue3.js.map +1 -0
- package/dist/components/SequenceInput.vue.d.ts +54 -0
- package/dist/components/SequenceInput.vue.js +204 -0
- package/dist/components/SequenceInput.vue.js.map +1 -0
- package/dist/components/SequenceInput.vue3.js +6 -0
- package/dist/components/SequenceInput.vue3.js.map +1 -0
- package/dist/components/SettingsButton.vue.d.ts +30 -0
- package/dist/components/SettingsButton.vue.js +72 -0
- package/dist/components/SettingsButton.vue.js.map +1 -0
- package/dist/components/SettingsButton.vue3.js +6 -0
- package/dist/components/SettingsButton.vue3.js.map +1 -0
- package/dist/components/SettingsModal.vue.d.ts +40 -0
- package/dist/components/SettingsModal.vue.js +141 -0
- package/dist/components/SettingsModal.vue.js.map +1 -0
- package/dist/components/SettingsModal.vue3.js +6 -0
- package/dist/components/SettingsModal.vue3.js.map +1 -0
- package/dist/components/Skeleton.vue.d.ts +11 -0
- package/dist/components/Skeleton.vue.js +65 -0
- package/dist/components/Skeleton.vue.js.map +1 -0
- package/dist/components/Skeleton.vue3.js +6 -0
- package/dist/components/Skeleton.vue3.js.map +1 -0
- package/dist/components/StatusIndicator.vue.d.ts +13 -0
- package/dist/components/StatusIndicator.vue.js +38 -0
- package/dist/components/StatusIndicator.vue.js.map +1 -0
- package/dist/components/StatusIndicator.vue3.js +6 -0
- package/dist/components/StatusIndicator.vue3.js.map +1 -0
- package/dist/components/StepWizard.vue.d.ts +72 -0
- package/dist/components/StepWizard.vue.js +213 -0
- package/dist/components/StepWizard.vue.js.map +1 -0
- package/dist/components/StepWizard.vue3.js +6 -0
- package/dist/components/StepWizard.vue3.js.map +1 -0
- package/dist/components/TagsInput.vue.d.ts +23 -0
- package/dist/components/TagsInput.vue.js +124 -0
- package/dist/components/TagsInput.vue.js.map +1 -0
- package/dist/components/TagsInput.vue3.js +6 -0
- package/dist/components/TagsInput.vue3.js.map +1 -0
- package/dist/components/ThemeToggle.vue.d.ts +7 -0
- package/dist/components/ThemeToggle.vue.js +49 -0
- package/dist/components/ThemeToggle.vue.js.map +1 -0
- package/dist/components/ThemeToggle.vue3.js +6 -0
- package/dist/components/ThemeToggle.vue3.js.map +1 -0
- package/dist/components/TimePicker.vue.d.ts +29 -0
- package/dist/components/TimePicker.vue.js +275 -0
- package/dist/components/TimePicker.vue.js.map +1 -0
- package/dist/components/TimePicker.vue3.js +6 -0
- package/dist/components/TimePicker.vue3.js.map +1 -0
- package/dist/components/TimeRangeInput.vue.d.ts +27 -0
- package/dist/components/TimeRangeInput.vue.js +115 -0
- package/dist/components/TimeRangeInput.vue.js.map +1 -0
- package/dist/components/TimeRangeInput.vue3.js +6 -0
- package/dist/components/TimeRangeInput.vue3.js.map +1 -0
- package/dist/components/ToastNotification.vue.d.ts +2 -0
- package/dist/components/ToastNotification.vue.js +113 -0
- package/dist/components/ToastNotification.vue.js.map +1 -0
- package/dist/components/ToastNotification.vue3.js +6 -0
- package/dist/components/ToastNotification.vue3.js.map +1 -0
- package/dist/components/Tooltip.vue.d.ts +25 -0
- package/dist/components/Tooltip.vue.js +52 -0
- package/dist/components/Tooltip.vue.js.map +1 -0
- package/dist/components/Tooltip.vue3.js +6 -0
- package/dist/components/Tooltip.vue3.js.map +1 -0
- package/dist/components/UnitInput.vue.d.ts +44 -0
- package/dist/components/UnitInput.vue.js +178 -0
- package/dist/components/UnitInput.vue.js.map +1 -0
- package/dist/components/UnitInput.vue3.js +6 -0
- package/dist/components/UnitInput.vue3.js.map +1 -0
- package/dist/components/WellEditPopup.vue.d.ts +25 -0
- package/dist/components/WellEditPopup.vue.js +250 -0
- package/dist/components/WellEditPopup.vue.js.map +1 -0
- package/dist/components/WellEditPopup.vue3.js +6 -0
- package/dist/components/WellEditPopup.vue3.js.map +1 -0
- package/dist/components/WellPlate.vue.d.ts +69 -0
- package/dist/components/WellPlate.vue.js +531 -0
- package/dist/components/WellPlate.vue.js.map +1 -0
- package/dist/components/WellPlate.vue3.js +6 -0
- package/dist/components/WellPlate.vue3.js.map +1 -0
- package/dist/components/index.d.ts +71 -0
- package/dist/components/index.js +215 -0
- package/dist/components/index.js.map +1 -0
- package/dist/composables/index.d.ts +17 -0
- package/dist/composables/index.js +49 -0
- package/dist/composables/index.js.map +1 -0
- package/dist/composables/useApi.d.ts +19 -0
- package/dist/composables/useApi.js +101 -0
- package/dist/composables/useApi.js.map +1 -0
- package/dist/composables/useAsync.d.ts +127 -0
- package/dist/composables/useAsync.js +141 -0
- package/dist/composables/useAsync.js.map +1 -0
- package/dist/composables/useAuth.d.ts +44 -0
- package/dist/composables/useAuth.js +286 -0
- package/dist/composables/useAuth.js.map +1 -0
- package/dist/composables/useChemicalFormula.d.ts +20 -0
- package/dist/composables/useChemicalFormula.js +228 -0
- package/dist/composables/useChemicalFormula.js.map +1 -0
- package/dist/composables/useConcentrationUnits.d.ts +28 -0
- package/dist/composables/useConcentrationUnits.js +154 -0
- package/dist/composables/useConcentrationUnits.js.map +1 -0
- package/dist/composables/useDoseCalculator.d.ts +57 -0
- package/dist/composables/useDoseCalculator.js +228 -0
- package/dist/composables/useDoseCalculator.js.map +1 -0
- package/dist/composables/useForm.d.ts +91 -0
- package/dist/composables/useForm.js +253 -0
- package/dist/composables/useForm.js.map +1 -0
- package/dist/composables/usePasskey.d.ts +9 -0
- package/dist/composables/usePasskey.js +171 -0
- package/dist/composables/usePasskey.js.map +1 -0
- package/dist/composables/usePlatformContext.d.ts +125 -0
- package/dist/composables/usePlatformContext.js +149 -0
- package/dist/composables/usePlatformContext.js.map +1 -0
- package/dist/composables/useProtocolTemplates.d.ts +43 -0
- package/dist/composables/useProtocolTemplates.js +437 -0
- package/dist/composables/useProtocolTemplates.js.map +1 -0
- package/dist/composables/useRackEditor.d.ts +30 -0
- package/dist/composables/useRackEditor.js +168 -0
- package/dist/composables/useRackEditor.js.map +1 -0
- package/dist/composables/useScheduleDrag.d.ts +77 -0
- package/dist/composables/useScheduleDrag.js +183 -0
- package/dist/composables/useScheduleDrag.js.map +1 -0
- package/dist/composables/useSequenceUtils.d.ts +13 -0
- package/dist/composables/useSequenceUtils.js +93 -0
- package/dist/composables/useSequenceUtils.js.map +1 -0
- package/dist/composables/useTheme.d.ts +7 -0
- package/dist/composables/useTheme.js +40 -0
- package/dist/composables/useTheme.js.map +1 -0
- package/dist/composables/useTimeUtils.d.ts +15 -0
- package/dist/composables/useTimeUtils.js +105 -0
- package/dist/composables/useTimeUtils.js.map +1 -0
- package/dist/composables/useToast.d.ts +19 -0
- package/dist/composables/useToast.js +33 -0
- package/dist/composables/useToast.js.map +1 -0
- package/dist/composables/useWellPlateEditor.d.ts +31 -0
- package/dist/composables/useWellPlateEditor.js +315 -0
- package/dist/composables/useWellPlateEditor.js.map +1 -0
- package/dist/histoire.setup.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +265 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +16 -0
- package/dist/install.js +15 -0
- package/dist/install.js.map +1 -0
- package/dist/stores/auth.d.ts +146 -0
- package/dist/stores/auth.js +122 -0
- package/dist/stores/auth.js.map +1 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/index.js +8 -0
- package/dist/stores/index.js.map +1 -0
- package/dist/stores/settings.d.ts +75 -0
- package/dist/stores/settings.js +180 -0
- package/dist/stores/settings.js.map +1 -0
- package/dist/styles.css +23264 -0
- package/dist/tailwind.preset.d.ts +56 -0
- package/dist/tailwind.preset.js +59 -0
- package/dist/tailwind.preset.js.map +1 -0
- package/dist/types/auth.d.ts +42 -0
- package/dist/types/components.d.ts +405 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/platform.d.ts +66 -0
- package/package.json +111 -0
- package/src/__tests__/components/AppLayout.test.ts +163 -0
- package/src/__tests__/components/AppSidebar.test.ts +292 -0
- package/src/__tests__/components/AppTopBar.test.ts +590 -0
- package/src/__tests__/components/BaseInput.test.ts +99 -0
- package/src/__tests__/components/BasePill.test.ts +291 -0
- package/src/__tests__/components/Calendar.test.ts +566 -0
- package/src/__tests__/components/CollapsibleCard.test.ts +524 -0
- package/src/__tests__/components/DataFrame.test.ts +767 -0
- package/src/__tests__/components/DropdownButton.test.ts +471 -0
- package/src/__tests__/composables/useAuth.test.ts +141 -0
- package/src/__tests__/composables/useForm.test.ts +205 -0
- package/src/components/AlertBox.story.vue +100 -0
- package/src/components/AlertBox.vue +68 -0
- package/src/components/AppContainer.story.vue +104 -0
- package/src/components/AppContainer.vue +33 -0
- package/src/components/AppLayout.story.vue +218 -0
- package/src/components/AppLayout.vue +75 -0
- package/src/components/AppSidebar.story.vue +300 -0
- package/src/components/AppSidebar.vue +114 -0
- package/src/components/AppTopBar.story.vue +112 -0
- package/src/components/AppTopBar.vue +471 -0
- package/src/components/AuditTrail.story.vue +163 -0
- package/src/components/AuditTrail.vue +161 -0
- package/src/components/Avatar.story.vue +92 -0
- package/src/components/Avatar.vue +65 -0
- package/src/components/BaseButton.story.vue +96 -0
- package/src/components/BaseButton.vue +72 -0
- package/src/components/BaseCheckbox.story.vue +73 -0
- package/src/components/BaseCheckbox.vue +68 -0
- package/src/components/BaseInput.story.vue +98 -0
- package/src/components/BaseInput.vue +70 -0
- package/src/components/BaseModal.story.vue +126 -0
- package/src/components/BaseModal.vue +118 -0
- package/src/components/BasePill.story.vue +131 -0
- package/src/components/BasePill.vue +84 -0
- package/src/components/BaseRadioGroup.story.vue +116 -0
- package/src/components/BaseRadioGroup.vue +83 -0
- package/src/components/BaseSelect.story.vue +110 -0
- package/src/components/BaseSelect.vue +67 -0
- package/src/components/BaseSlider.story.vue +82 -0
- package/src/components/BaseSlider.vue +112 -0
- package/src/components/BaseTabs.story.vue +106 -0
- package/src/components/BaseTabs.vue +58 -0
- package/src/components/BaseTextarea.story.vue +91 -0
- package/src/components/BaseTextarea.vue +58 -0
- package/src/components/BaseToggle.story.vue +81 -0
- package/src/components/BaseToggle.vue +72 -0
- package/src/components/BatchProgressList.story.vue +92 -0
- package/src/components/BatchProgressList.vue +202 -0
- package/src/components/Breadcrumb.story.vue +93 -0
- package/src/components/Breadcrumb.vue +73 -0
- package/src/components/Calendar.story.vue +106 -0
- package/src/components/Calendar.vue +362 -0
- package/src/components/ChartContainer.story.vue +113 -0
- package/src/components/ChartContainer.vue +63 -0
- package/src/components/ChemicalFormula.story.vue +102 -0
- package/src/components/ChemicalFormula.vue +38 -0
- package/src/components/CollapsibleCard.story.vue +124 -0
- package/src/components/CollapsibleCard.vue +164 -0
- package/src/components/ColorSlider.story.vue +120 -0
- package/src/components/ColorSlider.vue +163 -0
- package/src/components/ConcentrationInput.story.vue +77 -0
- package/src/components/ConcentrationInput.vue +184 -0
- package/src/components/ConfirmDialog.story.vue +145 -0
- package/src/components/ConfirmDialog.vue +96 -0
- package/src/components/DataFrame.story.vue +148 -0
- package/src/components/DataFrame.vue +418 -0
- package/src/components/DatePicker.story.vue +104 -0
- package/src/components/DatePicker.vue +298 -0
- package/src/components/DateTimePicker.story.vue +112 -0
- package/src/components/DateTimePicker.vue +391 -0
- package/src/components/Divider.story.vue +72 -0
- package/src/components/Divider.vue +45 -0
- package/src/components/DoseCalculator.story.vue +68 -0
- package/src/components/DoseCalculator.vue +475 -0
- package/src/components/DropdownButton.story.vue +102 -0
- package/src/components/DropdownButton.vue +180 -0
- package/src/components/EmptyState.story.vue +124 -0
- package/src/components/EmptyState.vue +64 -0
- package/src/components/ExperimentTimeline.story.vue +161 -0
- package/src/components/ExperimentTimeline.vue +381 -0
- package/src/components/FileUploader.story.vue +106 -0
- package/src/components/FileUploader.vue +397 -0
- package/src/components/FormField.story.vue +119 -0
- package/src/components/FormField.vue +37 -0
- package/src/components/FormulaInput.story.vue +96 -0
- package/src/components/FormulaInput.vue +123 -0
- package/src/components/GroupAssigner.story.vue +83 -0
- package/src/components/GroupAssigner.vue +283 -0
- package/src/components/GroupingModal.story.vue +52 -0
- package/src/components/GroupingModal.vue +420 -0
- package/src/components/IconButton.story.vue +135 -0
- package/src/components/IconButton.vue +72 -0
- package/src/components/LoadingSpinner.story.vue +70 -0
- package/src/components/LoadingSpinner.vue +49 -0
- package/src/components/MoleculeInput.story.vue +66 -0
- package/src/components/MoleculeInput.vue +414 -0
- package/src/components/MultiSelect.story.vue +121 -0
- package/src/components/MultiSelect.vue +117 -0
- package/src/components/NumberInput.story.vue +90 -0
- package/src/components/NumberInput.vue +128 -0
- package/src/components/PlateMapEditor.story.vue +92 -0
- package/src/components/PlateMapEditor.vue +512 -0
- package/src/components/ProgressBar.story.vue +117 -0
- package/src/components/ProgressBar.vue +63 -0
- package/src/components/ProtocolStepEditor.story.vue +69 -0
- package/src/components/ProtocolStepEditor.vue +521 -0
- package/src/components/RackEditor.story.vue +100 -0
- package/src/components/RackEditor.vue +370 -0
- package/src/components/ReagentList.story.vue +137 -0
- package/src/components/ReagentList.vue +487 -0
- package/src/components/ResourceCard.story.vue +150 -0
- package/src/components/ResourceCard.vue +160 -0
- package/src/components/SampleHierarchyTree.story.vue +161 -0
- package/src/components/SampleHierarchyTree.vue +279 -0
- package/src/components/SampleLegend.story.vue +91 -0
- package/src/components/SampleLegend.vue +118 -0
- package/src/components/SampleSelector.story.vue +100 -0
- package/src/components/SampleSelector.vue +955 -0
- package/src/components/ScheduleCalendar.story.vue +195 -0
- package/src/components/ScheduleCalendar.vue +568 -0
- package/src/components/ScientificNumber.story.vue +128 -0
- package/src/components/ScientificNumber.vue +197 -0
- package/src/components/SegmentedControl.story.vue +112 -0
- package/src/components/SegmentedControl.vue +78 -0
- package/src/components/SequenceInput.story.vue +119 -0
- package/src/components/SequenceInput.vue +208 -0
- package/src/components/SettingsButton.story.vue +58 -0
- package/src/components/SettingsButton.vue +75 -0
- package/src/components/SettingsModal.story.vue +145 -0
- package/src/components/SettingsModal.vue +151 -0
- package/src/components/Skeleton.story.vue +120 -0
- package/src/components/Skeleton.vue +73 -0
- package/src/components/StatusIndicator.story.vue +99 -0
- package/src/components/StatusIndicator.vue +39 -0
- package/src/components/StepWizard.story.vue +155 -0
- package/src/components/StepWizard.vue +231 -0
- package/src/components/TagsInput.story.vue +104 -0
- package/src/components/TagsInput.vue +127 -0
- package/src/components/ThemeToggle.story.vue +36 -0
- package/src/components/ThemeToggle.vue +53 -0
- package/src/components/TimePicker.story.vue +96 -0
- package/src/components/TimePicker.vue +272 -0
- package/src/components/TimeRangeInput.story.vue +104 -0
- package/src/components/TimeRangeInput.vue +121 -0
- package/src/components/ToastNotification.story.vue +130 -0
- package/src/components/ToastNotification.vue +54 -0
- package/src/components/Tooltip.story.vue +102 -0
- package/src/components/Tooltip.vue +61 -0
- package/src/components/UnitInput.story.vue +170 -0
- package/src/components/UnitInput.vue +218 -0
- package/src/components/WellEditPopup.vue +234 -0
- package/src/components/WellPlate.story.vue +198 -0
- package/src/components/WellPlate.vue +637 -0
- package/src/components/index.ts +96 -0
- package/src/composables/index.ts +87 -0
- package/src/composables/useApi.ts +145 -0
- package/src/composables/useAsync.ts +322 -0
- package/src/composables/useAuth.ts +427 -0
- package/src/composables/useChemicalFormula.ts +274 -0
- package/src/composables/useConcentrationUnits.ts +245 -0
- package/src/composables/useDoseCalculator.ts +369 -0
- package/src/composables/useForm.ts +415 -0
- package/src/composables/usePasskey.ts +209 -0
- package/src/composables/usePlatformContext.ts +232 -0
- package/src/composables/useProtocolTemplates.ts +517 -0
- package/src/composables/useRackEditor.ts +221 -0
- package/src/composables/useScheduleDrag.ts +244 -0
- package/src/composables/useSequenceUtils.ts +104 -0
- package/src/composables/useTheme.ts +49 -0
- package/src/composables/useTimeUtils.ts +114 -0
- package/src/composables/useToast.ts +39 -0
- package/src/composables/useWellPlateEditor.ts +408 -0
- package/src/histoire.setup.ts +17 -0
- package/src/index.ts +283 -0
- package/src/install.ts +32 -0
- package/src/stores/auth.ts +144 -0
- package/src/stores/index.ts +2 -0
- package/src/stores/settings.ts +229 -0
- package/src/styles/components/alert-box.css +94 -0
- package/src/styles/components/app-container.css +32 -0
- package/src/styles/components/app-layout.css +99 -0
- package/src/styles/components/app-sidebar.css +133 -0
- package/src/styles/components/app-top-bar.css +396 -0
- package/src/styles/components/audit-trail.css +143 -0
- package/src/styles/components/avatar.css +64 -0
- package/src/styles/components/batch-progress-list.css +196 -0
- package/src/styles/components/breadcrumb.css +45 -0
- package/src/styles/components/button.css +119 -0
- package/src/styles/components/calendar.css +192 -0
- package/src/styles/components/chart-container.css +69 -0
- package/src/styles/components/checkbox.css +112 -0
- package/src/styles/components/chemical-formula.css +46 -0
- package/src/styles/components/collapsible-card.css +184 -0
- package/src/styles/components/color-slider.css +110 -0
- package/src/styles/components/concentration-input.css +142 -0
- package/src/styles/components/confirm-dialog.css +137 -0
- package/src/styles/components/dataframe.css +382 -0
- package/src/styles/components/date-picker.css +239 -0
- package/src/styles/components/datetime-picker.css +225 -0
- package/src/styles/components/divider.css +62 -0
- package/src/styles/components/dose-calculator.css +301 -0
- package/src/styles/components/dropdown-button.css +236 -0
- package/src/styles/components/empty-state.css +148 -0
- package/src/styles/components/experiment-timeline.css +529 -0
- package/src/styles/components/file-uploader.css +517 -0
- package/src/styles/components/form-field.css +35 -0
- package/src/styles/components/formula-input.css +96 -0
- package/src/styles/components/group-assigner.css +200 -0
- package/src/styles/components/grouping-modal.css +323 -0
- package/src/styles/components/icon-button.css +128 -0
- package/src/styles/components/input.css +53 -0
- package/src/styles/components/loading-spinner.css +67 -0
- package/src/styles/components/modal.css +122 -0
- package/src/styles/components/molecule-input.css +186 -0
- package/src/styles/components/multi-select.css +131 -0
- package/src/styles/components/number-input.css +110 -0
- package/src/styles/components/pill.css +172 -0
- package/src/styles/components/plate-map-editor.css +464 -0
- package/src/styles/components/progress-bar.css +88 -0
- package/src/styles/components/protocol-step-editor.css +449 -0
- package/src/styles/components/rack-editor.css +259 -0
- package/src/styles/components/radio-group.css +158 -0
- package/src/styles/components/reagent-list.css +407 -0
- package/src/styles/components/resource-card.css +360 -0
- package/src/styles/components/sample-hierarchy-tree.css +314 -0
- package/src/styles/components/sample-legend.css +201 -0
- package/src/styles/components/sample-selector.css +701 -0
- package/src/styles/components/schedule-calendar.css +478 -0
- package/src/styles/components/scientific-number.css +63 -0
- package/src/styles/components/segmented-control.css +190 -0
- package/src/styles/components/select.css +72 -0
- package/src/styles/components/sequence-input.css +184 -0
- package/src/styles/components/settings-button.css +75 -0
- package/src/styles/components/settings-modal.css +95 -0
- package/src/styles/components/skeleton.css +36 -0
- package/src/styles/components/slider.css +78 -0
- package/src/styles/components/status-indicator.css +59 -0
- package/src/styles/components/step-wizard.css +187 -0
- package/src/styles/components/tabs.css +108 -0
- package/src/styles/components/tags-input.css +118 -0
- package/src/styles/components/textarea.css +65 -0
- package/src/styles/components/theme-toggle.css +50 -0
- package/src/styles/components/time-picker.css +171 -0
- package/src/styles/components/time-range-input.css +42 -0
- package/src/styles/components/toast.css +72 -0
- package/src/styles/components/toggle.css +115 -0
- package/src/styles/components/tooltip.css +98 -0
- package/src/styles/components/unit-input.css +138 -0
- package/src/styles/components/well-edit-popup.css +252 -0
- package/src/styles/components/well-plate.css +310 -0
- package/src/styles/index.css +80 -0
- package/src/styles/variables.css +1078 -0
- package/src/tailwind.preset.ts +59 -0
- package/src/types/auth.ts +55 -0
- package/src/types/components.ts +560 -0
- package/src/types/index.ts +146 -0
- package/src/types/platform.ts +101 -0
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import { ref } from 'vue'
|
|
4
|
+
import { createPinia } from 'pinia'
|
|
5
|
+
import AppTopBar from '../../components/AppTopBar.vue'
|
|
6
|
+
import ThemeToggle from '../../components/ThemeToggle.vue'
|
|
7
|
+
import SettingsModal from '../../components/SettingsModal.vue'
|
|
8
|
+
import type { TopBarSettingsConfig } from '../../types/components'
|
|
9
|
+
|
|
10
|
+
// Mock the usePlatformContext composable
|
|
11
|
+
vi.mock('../../composables/usePlatformContext', () => ({
|
|
12
|
+
usePlatformContext: vi.fn(() => ({
|
|
13
|
+
isIntegrated: ref(false),
|
|
14
|
+
context: ref({ isIntegrated: false, theme: 'system' }),
|
|
15
|
+
plugin: ref(undefined),
|
|
16
|
+
user: ref(undefined),
|
|
17
|
+
theme: ref('system'),
|
|
18
|
+
features: ref(undefined),
|
|
19
|
+
navigate: vi.fn(),
|
|
20
|
+
notify: vi.fn(),
|
|
21
|
+
sendToPlatform: vi.fn(),
|
|
22
|
+
})),
|
|
23
|
+
}))
|
|
24
|
+
|
|
25
|
+
// Mock the useTheme composable (used by ThemeToggle)
|
|
26
|
+
vi.mock('../../composables/useTheme', () => ({
|
|
27
|
+
useTheme: vi.fn(() => ({
|
|
28
|
+
isDark: ref(false),
|
|
29
|
+
theme: ref('light'),
|
|
30
|
+
toggleTheme: vi.fn(),
|
|
31
|
+
})),
|
|
32
|
+
}))
|
|
33
|
+
|
|
34
|
+
// Helper function to create test wrapper with all necessary stubs and plugins
|
|
35
|
+
function createWrapper(props = {}, slots = {}) {
|
|
36
|
+
const pinia = createPinia()
|
|
37
|
+
return mount(AppTopBar, {
|
|
38
|
+
props,
|
|
39
|
+
slots,
|
|
40
|
+
global: {
|
|
41
|
+
plugins: [pinia],
|
|
42
|
+
stubs: {
|
|
43
|
+
'router-link': {
|
|
44
|
+
template: '<a><slot /></a>',
|
|
45
|
+
},
|
|
46
|
+
BaseModal: {
|
|
47
|
+
template: '<div><slot /></div>',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
describe('AppTopBar', () => {
|
|
55
|
+
beforeEach(() => {
|
|
56
|
+
vi.clearAllMocks()
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
describe('default props behavior', () => {
|
|
60
|
+
it('should render without ThemeToggle by default', () => {
|
|
61
|
+
const wrapper = createWrapper({ title: 'Test App' })
|
|
62
|
+
expect(wrapper.findComponent(ThemeToggle).exists()).toBe(false)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it('should render without settings button by default', () => {
|
|
66
|
+
const wrapper = createWrapper({ title: 'Test App' })
|
|
67
|
+
expect(wrapper.find('.mld-topbar__settings-btn').exists()).toBe(false)
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('should render without SettingsModal by default', () => {
|
|
71
|
+
const wrapper = createWrapper({ title: 'Test App' })
|
|
72
|
+
expect(wrapper.findComponent(SettingsModal).exists()).toBe(false)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it('should show standalone badge by default when not integrated', () => {
|
|
76
|
+
const wrapper = createWrapper({ title: 'Test App' })
|
|
77
|
+
expect(wrapper.find('.mld-topbar__standalone-badge').exists()).toBe(true)
|
|
78
|
+
expect(wrapper.find('.mld-topbar__standalone-badge').text()).toBe('Standalone')
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
describe('showThemeToggle prop', () => {
|
|
83
|
+
it('should not render ThemeToggle when showThemeToggle is false', () => {
|
|
84
|
+
const wrapper = createWrapper({
|
|
85
|
+
title: 'Test App',
|
|
86
|
+
showThemeToggle: false,
|
|
87
|
+
})
|
|
88
|
+
expect(wrapper.findComponent(ThemeToggle).exists()).toBe(false)
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
it('should render ThemeToggle when showThemeToggle is true', () => {
|
|
92
|
+
const wrapper = createWrapper({
|
|
93
|
+
title: 'Test App',
|
|
94
|
+
showThemeToggle: true,
|
|
95
|
+
})
|
|
96
|
+
const themeToggle = wrapper.findComponent(ThemeToggle)
|
|
97
|
+
expect(themeToggle.exists()).toBe(true)
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it('should pass size="sm" to ThemeToggle', () => {
|
|
101
|
+
const wrapper = createWrapper({
|
|
102
|
+
title: 'Test App',
|
|
103
|
+
showThemeToggle: true,
|
|
104
|
+
})
|
|
105
|
+
const themeToggle = wrapper.findComponent(ThemeToggle)
|
|
106
|
+
expect(themeToggle.props('size')).toBe('sm')
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
it('should render ThemeToggle in right section', () => {
|
|
110
|
+
const wrapper = createWrapper({
|
|
111
|
+
title: 'Test App',
|
|
112
|
+
showThemeToggle: true,
|
|
113
|
+
})
|
|
114
|
+
const rightSection = wrapper.find('.mld-topbar__right')
|
|
115
|
+
expect(rightSection.findComponent(ThemeToggle).exists()).toBe(true)
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
describe('showSettings prop', () => {
|
|
120
|
+
it('should not render settings button when showSettings is false', () => {
|
|
121
|
+
const wrapper = createWrapper({
|
|
122
|
+
title: 'Test App',
|
|
123
|
+
showSettings: false,
|
|
124
|
+
})
|
|
125
|
+
expect(wrapper.find('.mld-topbar__settings-btn').exists()).toBe(false)
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
it('should render settings button when showSettings is true', () => {
|
|
129
|
+
const wrapper = createWrapper({
|
|
130
|
+
title: 'Test App',
|
|
131
|
+
showSettings: true,
|
|
132
|
+
})
|
|
133
|
+
const settingsBtn = wrapper.find('.mld-topbar__settings-btn')
|
|
134
|
+
expect(settingsBtn.exists()).toBe(true)
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
it('should render SettingsModal when showSettings is true', () => {
|
|
138
|
+
const wrapper = createWrapper({
|
|
139
|
+
title: 'Test App',
|
|
140
|
+
showSettings: true,
|
|
141
|
+
})
|
|
142
|
+
expect(wrapper.findComponent(SettingsModal).exists()).toBe(true)
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
it('should have aria-label on settings button', () => {
|
|
146
|
+
const wrapper = createWrapper({
|
|
147
|
+
title: 'Test App',
|
|
148
|
+
showSettings: true,
|
|
149
|
+
})
|
|
150
|
+
const settingsBtn = wrapper.find('.mld-topbar__settings-btn')
|
|
151
|
+
expect(settingsBtn.attributes('aria-label')).toBe('Open settings')
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
it('should render settings icon SVG', () => {
|
|
155
|
+
const wrapper = createWrapper({
|
|
156
|
+
title: 'Test App',
|
|
157
|
+
showSettings: true,
|
|
158
|
+
})
|
|
159
|
+
const settingsBtn = wrapper.find('.mld-topbar__settings-btn')
|
|
160
|
+
const icon = settingsBtn.find('.mld-topbar__settings-icon')
|
|
161
|
+
expect(icon.exists()).toBe(true)
|
|
162
|
+
expect(icon.element.tagName.toLowerCase()).toBe('svg')
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
describe('settings button interaction', () => {
|
|
167
|
+
it('should open SettingsModal when settings button is clicked', async () => {
|
|
168
|
+
const wrapper = createWrapper({
|
|
169
|
+
title: 'Test App',
|
|
170
|
+
showSettings: true,
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
const settingsBtn = wrapper.find('.mld-topbar__settings-btn')
|
|
174
|
+
await settingsBtn.trigger('click')
|
|
175
|
+
|
|
176
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
177
|
+
expect(settingsModal.props('modelValue')).toBe(true)
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
it('should initialize SettingsModal as closed', () => {
|
|
181
|
+
const wrapper = createWrapper({
|
|
182
|
+
title: 'Test App',
|
|
183
|
+
showSettings: true,
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
187
|
+
expect(settingsModal.props('modelValue')).toBe(false)
|
|
188
|
+
})
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
describe('settingsConfig prop', () => {
|
|
192
|
+
it('should pass title to SettingsModal', () => {
|
|
193
|
+
const settingsConfig: TopBarSettingsConfig = {
|
|
194
|
+
title: 'Custom Settings',
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const wrapper = createWrapper({
|
|
198
|
+
title: 'Test App',
|
|
199
|
+
showSettings: true,
|
|
200
|
+
settingsConfig,
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
204
|
+
expect(settingsModal.props('title')).toBe('Custom Settings')
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
it('should pass tabs to SettingsModal', () => {
|
|
208
|
+
const settingsConfig: TopBarSettingsConfig = {
|
|
209
|
+
tabs: [
|
|
210
|
+
{ id: 'general', label: 'General' },
|
|
211
|
+
{ id: 'advanced', label: 'Advanced' },
|
|
212
|
+
],
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const wrapper = createWrapper({
|
|
216
|
+
title: 'Test App',
|
|
217
|
+
showSettings: true,
|
|
218
|
+
settingsConfig,
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
222
|
+
expect(settingsModal.props('tabs')).toEqual(settingsConfig.tabs)
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
it('should pass showAppearance to SettingsModal', () => {
|
|
226
|
+
const settingsConfig: TopBarSettingsConfig = {
|
|
227
|
+
showAppearance: false,
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const wrapper = createWrapper({
|
|
231
|
+
title: 'Test App',
|
|
232
|
+
showSettings: true,
|
|
233
|
+
settingsConfig,
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
237
|
+
expect(settingsModal.props('showAppearance')).toBe(false)
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
it('should default showAppearance to true when not specified', () => {
|
|
241
|
+
const wrapper = createWrapper({
|
|
242
|
+
title: 'Test App',
|
|
243
|
+
showSettings: true,
|
|
244
|
+
settingsConfig: {},
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
248
|
+
expect(settingsModal.props('showAppearance')).toBe(true)
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
it('should pass size to SettingsModal', () => {
|
|
252
|
+
const settingsConfig: TopBarSettingsConfig = {
|
|
253
|
+
size: 'xl',
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const wrapper = createWrapper({
|
|
257
|
+
title: 'Test App',
|
|
258
|
+
showSettings: true,
|
|
259
|
+
settingsConfig,
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
263
|
+
expect(settingsModal.props('size')).toBe('xl')
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
it('should use default size when not specified', () => {
|
|
267
|
+
const wrapper = createWrapper({
|
|
268
|
+
title: 'Test App',
|
|
269
|
+
showSettings: true,
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
273
|
+
// SettingsModal defaults to 'lg' size
|
|
274
|
+
expect(settingsModal.props('size')).toBe('lg')
|
|
275
|
+
})
|
|
276
|
+
})
|
|
277
|
+
|
|
278
|
+
describe('settings tab slot forwarding', () => {
|
|
279
|
+
it('should forward settings-tab slots to SettingsModal', () => {
|
|
280
|
+
const settingsConfig: TopBarSettingsConfig = {
|
|
281
|
+
tabs: [{ id: 'general', label: 'General' }],
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const wrapper = createWrapper({
|
|
285
|
+
title: 'Test App',
|
|
286
|
+
showSettings: true,
|
|
287
|
+
settingsConfig,
|
|
288
|
+
}, {
|
|
289
|
+
'settings-tab-general': '<div class="custom-tab-content">Custom General Tab</div>',
|
|
290
|
+
})
|
|
291
|
+
|
|
292
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
293
|
+
expect(settingsModal.vm.$slots['tab-general']).toBeDefined()
|
|
294
|
+
})
|
|
295
|
+
|
|
296
|
+
it('should forward multiple settings-tab slots', () => {
|
|
297
|
+
const settingsConfig: TopBarSettingsConfig = {
|
|
298
|
+
tabs: [
|
|
299
|
+
{ id: 'general', label: 'General' },
|
|
300
|
+
{ id: 'advanced', label: 'Advanced' },
|
|
301
|
+
],
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const wrapper = createWrapper({
|
|
305
|
+
title: 'Test App',
|
|
306
|
+
showSettings: true,
|
|
307
|
+
settingsConfig,
|
|
308
|
+
}, {
|
|
309
|
+
'settings-tab-general': '<div>General Content</div>',
|
|
310
|
+
'settings-tab-advanced': '<div>Advanced Content</div>',
|
|
311
|
+
})
|
|
312
|
+
|
|
313
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
314
|
+
expect(settingsModal.vm.$slots['tab-general']).toBeDefined()
|
|
315
|
+
expect(settingsModal.vm.$slots['tab-advanced']).toBeDefined()
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
it('should forward settings-appearance slot', () => {
|
|
319
|
+
const wrapper = createWrapper({
|
|
320
|
+
title: 'Test App',
|
|
321
|
+
showSettings: true,
|
|
322
|
+
}, {
|
|
323
|
+
'settings-appearance': '<div class="custom-appearance">Custom Appearance</div>',
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
327
|
+
expect(settingsModal.vm.$slots.appearance).toBeDefined()
|
|
328
|
+
})
|
|
329
|
+
})
|
|
330
|
+
|
|
331
|
+
describe('showStandaloneLabel prop', () => {
|
|
332
|
+
it('should show standalone badge when showStandaloneLabel is true (default)', () => {
|
|
333
|
+
const wrapper = createWrapper({
|
|
334
|
+
title: 'Test App',
|
|
335
|
+
showStandaloneLabel: true,
|
|
336
|
+
})
|
|
337
|
+
expect(wrapper.find('.mld-topbar__standalone-badge').exists()).toBe(true)
|
|
338
|
+
})
|
|
339
|
+
|
|
340
|
+
it('should hide standalone badge when showStandaloneLabel is false', () => {
|
|
341
|
+
const wrapper = createWrapper({
|
|
342
|
+
title: 'Test App',
|
|
343
|
+
showStandaloneLabel: false,
|
|
344
|
+
})
|
|
345
|
+
expect(wrapper.find('.mld-topbar__standalone-badge').exists()).toBe(false)
|
|
346
|
+
})
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
describe('standaloneLabel prop', () => {
|
|
350
|
+
it('should display default "Standalone" label', () => {
|
|
351
|
+
const wrapper = createWrapper({
|
|
352
|
+
title: 'Test App',
|
|
353
|
+
})
|
|
354
|
+
const badge = wrapper.find('.mld-topbar__standalone-badge')
|
|
355
|
+
expect(badge.text()).toBe('Standalone')
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
it('should display custom standalone label', () => {
|
|
359
|
+
const wrapper = createWrapper({
|
|
360
|
+
title: 'Test App',
|
|
361
|
+
standaloneLabel: 'Demo Mode',
|
|
362
|
+
})
|
|
363
|
+
const badge = wrapper.find('.mld-topbar__standalone-badge')
|
|
364
|
+
expect(badge.text()).toBe('Demo Mode')
|
|
365
|
+
})
|
|
366
|
+
|
|
367
|
+
it('should support empty string as label', () => {
|
|
368
|
+
const wrapper = createWrapper({
|
|
369
|
+
title: 'Test App',
|
|
370
|
+
standaloneLabel: '',
|
|
371
|
+
})
|
|
372
|
+
const badge = wrapper.find('.mld-topbar__standalone-badge')
|
|
373
|
+
expect(badge.text()).toBe('')
|
|
374
|
+
})
|
|
375
|
+
})
|
|
376
|
+
|
|
377
|
+
describe('standalone detection with platform integration', () => {
|
|
378
|
+
it('should hide standalone badge when integrated with platform', () => {
|
|
379
|
+
// This test verifies the component logic when isIntegrated changes
|
|
380
|
+
// Since we can't easily change the mock mid-test, we'll skip the runtime test
|
|
381
|
+
// The component code correctly checks isStandalone computed property
|
|
382
|
+
const wrapper = createWrapper({
|
|
383
|
+
title: 'Test App',
|
|
384
|
+
showStandaloneLabel: true,
|
|
385
|
+
})
|
|
386
|
+
|
|
387
|
+
// In non-integrated mode (default mock), badge should be visible
|
|
388
|
+
expect(wrapper.find('.mld-topbar__standalone-badge').exists()).toBe(true)
|
|
389
|
+
})
|
|
390
|
+
})
|
|
391
|
+
|
|
392
|
+
describe('combined features', () => {
|
|
393
|
+
it('should render ThemeToggle and settings button together', () => {
|
|
394
|
+
const wrapper = createWrapper({
|
|
395
|
+
title: 'Test App',
|
|
396
|
+
showThemeToggle: true,
|
|
397
|
+
showSettings: true,
|
|
398
|
+
})
|
|
399
|
+
|
|
400
|
+
expect(wrapper.findComponent(ThemeToggle).exists()).toBe(true)
|
|
401
|
+
expect(wrapper.find('.mld-topbar__settings-btn').exists()).toBe(true)
|
|
402
|
+
})
|
|
403
|
+
|
|
404
|
+
it('should render standalone badge, ThemeToggle, and settings button together', () => {
|
|
405
|
+
const wrapper = createWrapper({
|
|
406
|
+
title: 'Test App',
|
|
407
|
+
showThemeToggle: true,
|
|
408
|
+
showSettings: true,
|
|
409
|
+
showStandaloneLabel: true,
|
|
410
|
+
standaloneLabel: 'Offline',
|
|
411
|
+
})
|
|
412
|
+
|
|
413
|
+
expect(wrapper.find('.mld-topbar__standalone-badge').exists()).toBe(true)
|
|
414
|
+
expect(wrapper.find('.mld-topbar__standalone-badge').text()).toBe('Offline')
|
|
415
|
+
expect(wrapper.findComponent(ThemeToggle).exists()).toBe(true)
|
|
416
|
+
expect(wrapper.find('.mld-topbar__settings-btn').exists()).toBe(true)
|
|
417
|
+
})
|
|
418
|
+
|
|
419
|
+
it('should maintain existing topbar functionality with new features', () => {
|
|
420
|
+
const wrapper = createWrapper({
|
|
421
|
+
title: 'My Plugin',
|
|
422
|
+
subtitle: 'Version 1.0',
|
|
423
|
+
showThemeToggle: true,
|
|
424
|
+
showSettings: true,
|
|
425
|
+
showStandaloneLabel: true,
|
|
426
|
+
})
|
|
427
|
+
|
|
428
|
+
// Verify title and subtitle still render
|
|
429
|
+
expect(wrapper.text()).toContain('My Plugin')
|
|
430
|
+
expect(wrapper.text()).toContain('Version 1.0')
|
|
431
|
+
|
|
432
|
+
// Verify new features render
|
|
433
|
+
expect(wrapper.findComponent(ThemeToggle).exists()).toBe(true)
|
|
434
|
+
expect(wrapper.find('.mld-topbar__settings-btn').exists()).toBe(true)
|
|
435
|
+
expect(wrapper.find('.mld-topbar__standalone-badge').exists()).toBe(true)
|
|
436
|
+
})
|
|
437
|
+
|
|
438
|
+
it('should render all elements in correct order in right section', () => {
|
|
439
|
+
const wrapper = createWrapper({
|
|
440
|
+
title: 'Test App',
|
|
441
|
+
showThemeToggle: true,
|
|
442
|
+
showSettings: true,
|
|
443
|
+
showStandaloneLabel: true,
|
|
444
|
+
}, {
|
|
445
|
+
actions: '<button class="custom-action">Action</button>',
|
|
446
|
+
})
|
|
447
|
+
|
|
448
|
+
const rightSection = wrapper.find('.mld-topbar__right')
|
|
449
|
+
expect(rightSection.exists()).toBe(true)
|
|
450
|
+
|
|
451
|
+
// Verify all expected elements are present
|
|
452
|
+
expect(wrapper.find('.mld-topbar__standalone-badge').exists()).toBe(true)
|
|
453
|
+
expect(wrapper.find('.custom-action').exists()).toBe(true)
|
|
454
|
+
expect(wrapper.find('.mld-topbar__settings-btn').exists()).toBe(true)
|
|
455
|
+
expect(wrapper.findComponent(ThemeToggle).exists()).toBe(true)
|
|
456
|
+
})
|
|
457
|
+
})
|
|
458
|
+
|
|
459
|
+
describe('backward compatibility', () => {
|
|
460
|
+
it('should not break existing usage without new props', () => {
|
|
461
|
+
const wrapper = createWrapper({
|
|
462
|
+
title: 'Legacy App',
|
|
463
|
+
subtitle: 'Old API',
|
|
464
|
+
})
|
|
465
|
+
|
|
466
|
+
expect(wrapper.find('.mld-topbar').exists()).toBe(true)
|
|
467
|
+
expect(wrapper.findComponent(ThemeToggle).exists()).toBe(false)
|
|
468
|
+
expect(wrapper.find('.mld-topbar__settings-btn').exists()).toBe(false)
|
|
469
|
+
// Standalone badge still shows by default in standalone mode
|
|
470
|
+
expect(wrapper.find('.mld-topbar__standalone-badge').exists()).toBe(true)
|
|
471
|
+
})
|
|
472
|
+
|
|
473
|
+
it('should work with existing pages and tabs props', () => {
|
|
474
|
+
const wrapper = createWrapper({
|
|
475
|
+
pluginName: 'Test Plugin',
|
|
476
|
+
title: 'Dashboard',
|
|
477
|
+
pages: [
|
|
478
|
+
{ id: 'dashboard', label: 'Dashboard' },
|
|
479
|
+
{ id: 'settings', label: 'Settings' },
|
|
480
|
+
],
|
|
481
|
+
tabs: [
|
|
482
|
+
{ id: 'overview', label: 'Overview' },
|
|
483
|
+
{ id: 'details', label: 'Details' },
|
|
484
|
+
],
|
|
485
|
+
showThemeToggle: true,
|
|
486
|
+
showSettings: true,
|
|
487
|
+
})
|
|
488
|
+
|
|
489
|
+
expect(wrapper.text()).toContain('Test Plugin')
|
|
490
|
+
expect(wrapper.text()).toContain('Dashboard')
|
|
491
|
+
expect(wrapper.findComponent(ThemeToggle).exists()).toBe(true)
|
|
492
|
+
expect(wrapper.find('.mld-topbar__settings-btn').exists()).toBe(true)
|
|
493
|
+
})
|
|
494
|
+
})
|
|
495
|
+
|
|
496
|
+
describe('edge cases', () => {
|
|
497
|
+
it('should handle empty settingsConfig object', () => {
|
|
498
|
+
const wrapper = createWrapper({
|
|
499
|
+
title: 'Test App',
|
|
500
|
+
showSettings: true,
|
|
501
|
+
settingsConfig: {},
|
|
502
|
+
})
|
|
503
|
+
|
|
504
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
505
|
+
// SettingsModal has default values for these props
|
|
506
|
+
expect(settingsModal.props('title')).toBe('Settings')
|
|
507
|
+
expect(settingsModal.props('tabs')).toEqual([])
|
|
508
|
+
expect(settingsModal.props('showAppearance')).toBe(true)
|
|
509
|
+
expect(settingsModal.props('size')).toBe('lg')
|
|
510
|
+
})
|
|
511
|
+
|
|
512
|
+
it('should handle settingsConfig with only some fields', () => {
|
|
513
|
+
const settingsConfig: TopBarSettingsConfig = {
|
|
514
|
+
title: 'Partial Config',
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
const wrapper = createWrapper({
|
|
518
|
+
title: 'Test App',
|
|
519
|
+
showSettings: true,
|
|
520
|
+
settingsConfig,
|
|
521
|
+
})
|
|
522
|
+
|
|
523
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
524
|
+
expect(settingsModal.props('title')).toBe('Partial Config')
|
|
525
|
+
// SettingsModal defaults tabs to empty array
|
|
526
|
+
expect(settingsModal.props('tabs')).toEqual([])
|
|
527
|
+
expect(settingsModal.props('showAppearance')).toBe(true)
|
|
528
|
+
// SettingsModal defaults size to 'lg'
|
|
529
|
+
expect(settingsModal.props('size')).toBe('lg')
|
|
530
|
+
})
|
|
531
|
+
|
|
532
|
+
it('should handle standalone label with special characters', () => {
|
|
533
|
+
const wrapper = createWrapper({
|
|
534
|
+
title: 'Test App',
|
|
535
|
+
standaloneLabel: '🚀 Preview',
|
|
536
|
+
})
|
|
537
|
+
|
|
538
|
+
const badge = wrapper.find('.mld-topbar__standalone-badge')
|
|
539
|
+
expect(badge.text()).toBe('🚀 Preview')
|
|
540
|
+
})
|
|
541
|
+
|
|
542
|
+
it('should handle very long standalone label', () => {
|
|
543
|
+
const longLabel = 'This is a very long standalone mode label text'
|
|
544
|
+
const wrapper = createWrapper({
|
|
545
|
+
title: 'Test App',
|
|
546
|
+
standaloneLabel: longLabel,
|
|
547
|
+
})
|
|
548
|
+
|
|
549
|
+
const badge = wrapper.find('.mld-topbar__standalone-badge')
|
|
550
|
+
expect(badge.text()).toBe(longLabel)
|
|
551
|
+
})
|
|
552
|
+
})
|
|
553
|
+
|
|
554
|
+
describe('type safety', () => {
|
|
555
|
+
it('should accept valid settingsConfig with all fields', () => {
|
|
556
|
+
const settingsConfig: TopBarSettingsConfig = {
|
|
557
|
+
title: 'Complete Settings',
|
|
558
|
+
tabs: [
|
|
559
|
+
{ id: 'general', label: 'General', icon: 'settings' },
|
|
560
|
+
{ id: 'advanced', label: 'Advanced' },
|
|
561
|
+
],
|
|
562
|
+
showAppearance: true,
|
|
563
|
+
size: 'lg',
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
const wrapper = createWrapper({
|
|
567
|
+
title: 'Test App',
|
|
568
|
+
showSettings: true,
|
|
569
|
+
settingsConfig,
|
|
570
|
+
})
|
|
571
|
+
|
|
572
|
+
expect(wrapper.findComponent(SettingsModal).exists()).toBe(true)
|
|
573
|
+
})
|
|
574
|
+
|
|
575
|
+
it('should accept all valid size options', () => {
|
|
576
|
+
const sizes: Array<'md' | 'lg' | 'xl'> = ['md', 'lg', 'xl']
|
|
577
|
+
|
|
578
|
+
sizes.forEach((size) => {
|
|
579
|
+
const wrapper = createWrapper({
|
|
580
|
+
title: 'Test App',
|
|
581
|
+
showSettings: true,
|
|
582
|
+
settingsConfig: { size },
|
|
583
|
+
})
|
|
584
|
+
|
|
585
|
+
const settingsModal = wrapper.findComponent(SettingsModal)
|
|
586
|
+
expect(settingsModal.props('size')).toBe(size)
|
|
587
|
+
})
|
|
588
|
+
})
|
|
589
|
+
})
|
|
590
|
+
})
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import BaseInput from '../../components/BaseInput.vue'
|
|
4
|
+
|
|
5
|
+
describe('BaseInput', () => {
|
|
6
|
+
describe('text input', () => {
|
|
7
|
+
it('should emit string value on input', async () => {
|
|
8
|
+
const wrapper = mount(BaseInput, {
|
|
9
|
+
props: { modelValue: '', type: 'text' },
|
|
10
|
+
})
|
|
11
|
+
const input = wrapper.find('input')
|
|
12
|
+
await input.setValue('hello')
|
|
13
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['hello'])
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
describe('number input', () => {
|
|
18
|
+
it('should emit number value on input', async () => {
|
|
19
|
+
const wrapper = mount(BaseInput, {
|
|
20
|
+
props: { modelValue: 0, type: 'number' },
|
|
21
|
+
})
|
|
22
|
+
const input = wrapper.find('input')
|
|
23
|
+
// Simulate typing a number
|
|
24
|
+
Object.defineProperty(input.element, 'value', { value: '42', writable: true })
|
|
25
|
+
await input.trigger('input')
|
|
26
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual([42])
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
it('should emit null for empty number input', async () => {
|
|
30
|
+
const wrapper = mount(BaseInput, {
|
|
31
|
+
props: { modelValue: 5, type: 'number' },
|
|
32
|
+
})
|
|
33
|
+
const input = wrapper.find('input')
|
|
34
|
+
// Simulate clearing the input
|
|
35
|
+
Object.defineProperty(input.element, 'value', { value: '', writable: true })
|
|
36
|
+
await input.trigger('input')
|
|
37
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual([null])
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it('should not emit NaN for empty number input', async () => {
|
|
41
|
+
const wrapper = mount(BaseInput, {
|
|
42
|
+
props: { modelValue: 5, type: 'number' },
|
|
43
|
+
})
|
|
44
|
+
const input = wrapper.find('input')
|
|
45
|
+
Object.defineProperty(input.element, 'value', { value: '', writable: true })
|
|
46
|
+
await input.trigger('input')
|
|
47
|
+
const emitted = wrapper.emitted('update:modelValue')?.[0]?.[0]
|
|
48
|
+
expect(emitted).not.toBeNaN()
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
describe('props', () => {
|
|
53
|
+
it('should apply disabled attribute', () => {
|
|
54
|
+
const wrapper = mount(BaseInput, {
|
|
55
|
+
props: { modelValue: '', disabled: true },
|
|
56
|
+
})
|
|
57
|
+
expect(wrapper.find('input').attributes('disabled')).toBeDefined()
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it('should apply placeholder', () => {
|
|
61
|
+
const wrapper = mount(BaseInput, {
|
|
62
|
+
props: { modelValue: '', placeholder: 'Enter text' },
|
|
63
|
+
})
|
|
64
|
+
expect(wrapper.find('input').attributes('placeholder')).toBe('Enter text')
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it('should apply error class', () => {
|
|
68
|
+
const wrapper = mount(BaseInput, {
|
|
69
|
+
props: { modelValue: '', error: true },
|
|
70
|
+
})
|
|
71
|
+
expect(wrapper.find('input').classes()).toContain('mld-input--error')
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it('should apply size class', () => {
|
|
75
|
+
const wrapper = mount(BaseInput, {
|
|
76
|
+
props: { modelValue: '', size: 'lg' },
|
|
77
|
+
})
|
|
78
|
+
expect(wrapper.find('input').classes()).toContain('mld-input--lg')
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
describe('events', () => {
|
|
83
|
+
it('should emit focus event', async () => {
|
|
84
|
+
const wrapper = mount(BaseInput, {
|
|
85
|
+
props: { modelValue: '' },
|
|
86
|
+
})
|
|
87
|
+
await wrapper.find('input').trigger('focus')
|
|
88
|
+
expect(wrapper.emitted('focus')).toHaveLength(1)
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
it('should emit blur event', async () => {
|
|
92
|
+
const wrapper = mount(BaseInput, {
|
|
93
|
+
props: { modelValue: '' },
|
|
94
|
+
})
|
|
95
|
+
await wrapper.find('input').trigger('blur')
|
|
96
|
+
expect(wrapper.emitted('blur')).toHaveLength(1)
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
})
|