Skip to content

Commit 9b3b208

Browse files
fix: hide hint in time mode mt-datepicker (#985)
* fix: hide hint in time mode * chore: add changeset * fix: update failing test * update snapshots
1 parent bca848a commit 9b3b208

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

.changeset/lucky-forks-build.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@shopware-ag/meteor-component-library": patch
3+
---
4+
5+
fix: hide time hint in `mt-datepicker`
-785 Bytes
Loading
-778 Bytes
Loading

packages/component-library/src/components/form/mt-datepicker/mt-datepicker.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe("mt-datepicker", () => {
6363
expect(screen.queryByTestId("time-zone-hint")).not.toBeInTheDocument();
6464
});
6565

66-
it("shows the timezone when displaying only the time", async () => {
66+
it("does not show the timezone when displaying only the time", async () => {
6767
// ARRANGE
6868
await render(MtDatepicker, {
6969
props: {
@@ -73,7 +73,7 @@ describe("mt-datepicker", () => {
7373
});
7474

7575
// ASSERT
76-
expect(screen.getByTestId("time-zone-hint")).toBeVisible();
76+
expect(screen.queryByTestId("time-zone-hint")).not.toBeInTheDocument();
7777
});
7878

7979
it("shows the timezone when displaying a datetime", async () => {

packages/component-library/src/components/form/mt-datepicker/mt-datepicker.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ export default defineComponent({
379379
watch: {
380380
dateType: {
381381
handler() {
382-
this.isTimeHintVisible = this.dateType !== "date";
382+
this.isTimeHintVisible = this.dateType === "datetime";
383383
this.updateOpacitySettings();
384384
},
385385
immediate: true,
@@ -393,7 +393,7 @@ export default defineComponent({
393393
},
394394
395395
mounted() {
396-
this.isTimeHintVisible = this.dateType !== "date";
396+
this.isTimeHintVisible = this.dateType === "datetime";
397397
this.updateOpacitySettings();
398398
},
399399

0 commit comments

Comments
 (0)