Skip to content

Commit fa6bc43

Browse files
authored
Merge pull request #172 from ofaruk84/fix-timepicker-test
Fix: TimePicker Component Test
2 parents 39e0491 + 1b00783 commit fa6bc43

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

SiemensIXBlazor.Tests/KPITest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public void ComponentRendersWithParametersSetCorrectly()
2727
.Add(p => p.Value, "testValue"));
2828

2929
// Assert
30-
cut.MarkupMatches("<ix-kpi label=\"testLabel\" value=\"testValue\" orientation=\"horizontal\" state=\"neutral\" onreadystatechange=\"Neutral\" unit=\"testUnit\"></ix-kpi>");
30+
cut.MarkupMatches("<ix-kpi label=\"testLabel\" value=\"testValue\" orientation=\"horizontal\" state=\"neutral\" onreadystatechange=\"Neutral\" unit=\"testUnit\" aria-label-warning-icon=\"AriaLabelWarningIcon\"></ix-kpi>");
31+
3132
}
32-
}
33+
}

SiemensIXBlazor.Tests/TimePickerTests.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ public void CornersRenderCorrectly(DatePickerCorners corners, string expected)
6060
[Fact]
6161
public void ComponentRendersWithAllParametersSetCorrectly()
6262
{
63-
// Because Format is a static property, set it directly
64-
TimePicker.Format = "MM-dd";
65-
6663
// Arrange & Act
6764
var cut = RenderComponent<TimePicker>(parameters => parameters
6865
.AddUnmatched("data-test", "my-value")
@@ -75,13 +72,18 @@ public void ComponentRendersWithAllParametersSetCorrectly()
7572
.Add(p => p.Time, "2025-04-24T15:30:00")
7673
.Add(p => p.Class, "my-class")
7774
.Add(p => p.Style, "color:red;")
75+
.Add(p=>p.Format,"MM-dd")
7876
);
7977

8078
// Assert full markup
8179
cut.MarkupMatches(
8280
@"<ix-time-picker data-test=""my-value"" id=""tp1""
8381
corners=""left""
8482
format=""MM-dd""
83+
hour-interval=""1""
84+
millisecond-interval=""1""
85+
minute-interval=""1""
86+
second-interval=""1""
8587
show-hour
8688
show-minutes
8789
show-seconds
@@ -91,9 +93,6 @@ public void ComponentRendersWithAllParametersSetCorrectly()
9193
class=""my-class"">
9294
</ix-time-picker>"
9395
);
94-
95-
// Reset static Format to default for other tests
96-
TimePicker.Format = "yyyy/MM/dd";
9796
}
9897

9998
[Fact]
@@ -134,4 +133,4 @@ public async Task DoneAndTimeChanged_JsInvokable_InvokeEventCallbacks()
134133
private string? DoneValue { get; set; }
135134
private string? TimeChangedValue { get; set; }
136135
}
137-
}
136+
}

0 commit comments

Comments
 (0)