Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Affix/Affix.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public partial class Affix

private string? StyleString => CssBuilder.Default("position: sticky;")
.AddStyle("z-index", $"{ZIndex}", ZIndex.HasValue)
.AddStyle($"{Position.ToDescriptionString()}", $"{Offset}px")
.AddStyle(Position.ToDescriptionString(), $"{Offset}px")
.AddStyleFromAttributes(AdditionalAttributes)
.Build();
}
6 changes: 3 additions & 3 deletions src/BootstrapBlazor/Components/Drawer/Drawer.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ public partial class Drawer
.Build();

private string? StyleString => CssBuilder.Default()
.AddStyle("--bb-drawer-position", $"{Position}", !string.IsNullOrEmpty(Position))
.AddStyle("--bb-drawer-position", Position)
.AddStyleFromAttributes(AdditionalAttributes)
.Build();

/// <summary>
/// 获得 抽屉 Style 字符串
/// </summary>
private string? DrawerStyleString => CssBuilder.Default()
.AddStyle("--bb-drawer-width", $"{Width}", !string.IsNullOrEmpty(Width) && Placement != Placement.Top && Placement != Placement.Bottom)
.AddStyle("--bb-drawer-height", $"{Height}", !string.IsNullOrEmpty(Height) && (Placement == Placement.Top || Placement == Placement.Bottom))
.AddStyle("--bb-drawer-width", Width, Placement != Placement.Top && Placement != Placement.Bottom)
.AddStyle("--bb-drawer-height", Height, Placement == Placement.Top || Placement == Placement.Bottom)
.Build();

/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion src/BootstrapBlazor/Services/WebClientService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public async Task<ClientInfo> GetClientInfo()
// 等待 SetData 方法执行完毕
try
{
await _taskCompletionSource.Task.WaitAsync(TimeSpan.FromSeconds(1));
await _taskCompletionSource.Task.WaitAsync(TimeSpan.FromSeconds(3));
}
catch (TimeoutException) { }
catch (Exception ex)
{
logger.LogError(ex, "method GetClientInfo failed");
Expand Down
8 changes: 7 additions & 1 deletion test/UnitTest/Services/WebClientServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,17 @@ public async Task WebClientOptions_Ok()
}

[Fact]
public async Task Timeout_Ok()
public async Task GetClientInfo_Error()
{
var service = Context.Services.GetRequiredService<WebClientService>();
var client = await service.GetClientInfo();

// TimeoutException
Assert.Null(client.Ip);

// Exception
Context.JSInterop.SetupVoid("ping", _ => true).SetException(new Exception("test-exception"));
client = await service.GetClientInfo();
}

[Fact]
Expand Down
Loading