Skip to content

Commit 4c61e9a

Browse files
committed
Update OnAutoFitContentAsync to accept calcWidth parameter
Modified the UnitTest
1 parent e5fc452 commit 4c61e9a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/UnitTest/Components/TableTest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8383,9 +8383,10 @@ public async Task AutoFitContentCallback_Ok()
83838383
pb.Add(a => a.AllowDragColumn, true);
83848384
pb.Add(a => a.ClientTableName, "table-unit-test");
83858385
pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
8386-
pb.Add(a => a.OnAutoFitContentAsync, fieldName =>
8386+
pb.Add(a => a.OnAutoFitContentAsync, (fieldName,calcWidth) =>
83878387
{
83888388
name = fieldName;
8389+
var resWidth = Math.Max(100.65f, calcWidth);
83898390
return Task.FromResult(100.65f);
83908391
});
83918392
pb.Add(a => a.TableColumns, foo => builder =>
@@ -8405,7 +8406,7 @@ public async Task AutoFitContentCallback_Ok()
84058406

84068407
var table = cut.FindComponent<Table<Foo>>();
84078408
float v = 0f;
8408-
await cut.InvokeAsync(async () => v = await table.Instance.AutoFitContentCallback("DateTime"));
8409+
await cut.InvokeAsync(async () => v = await table.Instance.AutoFitContentCallback("DateTime",90));
84098410
Assert.Equal(100.65f, v);
84108411
}
84118412

0 commit comments

Comments
 (0)