fix(adminui): CSV import grid shows the raw name/group of an invalid row (#847)
This commit is contained in:
@@ -47,6 +47,30 @@ public sealed class HeidenhainAuthoringUxTests
|
||||
result.CanCommit.ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Csv_preview_invalid_rows_echo_the_raw_name_and_group_847()
|
||||
{
|
||||
// lmxopcua#847: an invalid row rendered a BLANK Name in the review grid, so the operator could not tell
|
||||
// which tag failed. Every rejection path must carry the raw Name/group cell as typed.
|
||||
const string header = "Name,DataType,AccessLevel,TagGroupPath,TagConfigJson";
|
||||
var exec = Json("""{"address":"Status/ExecutionState"}""");
|
||||
var result = RawTagCsvMapper.Parse(DriverTypeNames.Heidenhain,
|
||||
header + "\n" + string.Join("\n",
|
||||
$"rw,Int32,ReadWrite,Spindle,{exec}", // row rule refusal
|
||||
$"nodt,,Read,,{exec}", // DataType required
|
||||
$"badjson,Int32,Read,,{Json("{not json")}",
|
||||
$"bad/name,Int32,Read,,{exec}", // name segment refusal
|
||||
$"badacc,Int32,Bogus,,{exec}"), // FormatException path
|
||||
groupPathPrefix: "Axes");
|
||||
|
||||
result.Rows.Count.ShouldBe(5);
|
||||
result.Rows.ShouldAllBe(r => !r.Ok);
|
||||
result.Rows.Select(r => r.Name).ShouldBe(new[] { "rw", "nodt", "badjson", "bad/name", "badacc" });
|
||||
result.Rows[0].EffectiveGroupPath.ShouldBe("Axes/Spindle");
|
||||
result.Rows[1].EffectiveGroupPath.ShouldBe("Axes");
|
||||
result.Rows.Select(r => r.RowNumber).ShouldBe(new[] { 1, 2, 3, 4, 5 });
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Csv_preview_and_ImportTags_agree_row_for_row()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user