Skip to content

Commit 2d478f7

Browse files
authored
refactor(Captcha): update javascript (#2418)
* refactor: 修复 Captcha 失败问题 * chore: bump version 8.0.3-beta04 * test: 更新单元测试
1 parent 91a31b5 commit 2d478f7

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>8.0.3-beta03</Version>
4+
<Version>8.0.3-beta04</Version>
55
</PropertyGroup>
66

77
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">

src/BootstrapBlazor/Components/Captcha/Captcha.razor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function init(id, invoke, callback, option) {
1212
const bar = block.getContext('2d', { willReadFrequently: true })
1313
const load = el.querySelector(".captcha-load")
1414
const footer = el.querySelector('.captcha-footer')
15-
const barLeft = footer.querySelector('.captcha-bar-bg')
15+
const barLeft = footer.querySelector('.captcha-bar-mask')
1616
const slider = el.querySelector('.captcha-bar')
1717
const barTextEl = el.querySelector('.captcha-bar-text')
1818
const refresh = el.querySelector('.captcha-refresh')

test/UnitTest/Components/QueryBuilderTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void HeaderTemplate_Ok()
3636
}
3737

3838
[Fact]
39-
public void Dropdown_Ok()
39+
public async Task Dropdown_Ok()
4040
{
4141
var cut = Context.RenderComponent<QueryBuilder<Foo>>();
4242
var items = cut.FindAll(".dropdown-item");
@@ -45,31 +45,31 @@ public void Dropdown_Ok()
4545
Assert.Single(groups);
4646

4747
// 点击组合条件 dropdown-item
48-
items[0].Click();
48+
await cut.InvokeAsync(() => items[0].Click());
4949
groups = cut.FindAll("ul");
5050

5151
// 两个组合条件
5252
Assert.Equal(2, groups.Count);
5353

5454
// 点击删除按钮
5555
var btn = cut.Find(".btn-remove");
56-
btn.Click();
56+
await cut.InvokeAsync(() => btn.Click());
5757
groups = cut.FindAll("ul");
5858

5959
// 还有一个组合条件
6060
Assert.Single(groups);
6161

6262
// 点击单行条件 dropdown-item
6363
items = cut.FindAll(".dropdown-item");
64-
items[1].Click();
64+
await cut.InvokeAsync(() => items[1].Click());
6565
var rows = cut.FindAll(".qb-row");
6666

6767
// 有一个单行条件
6868
Assert.Single(rows);
6969

7070
// 点击 btn-plus 按钮
7171
var plus = cut.Find(".btn-plus");
72-
plus.Click();
72+
await cut.InvokeAsync(() => plus.Click());
7373
rows = cut.FindAll(".qb-row");
7474

7575
// 有两个单行条件
@@ -78,7 +78,7 @@ public void Dropdown_Ok()
7878
// 点击 btn-minus 按钮
7979
var buttons = cut.FindAll(".btn-minus");
8080
Assert.Equal(2, buttons.Count);
81-
buttons[1].Click();
81+
await cut.InvokeAsync(() => buttons[1].Click());
8282

8383
// 有一个单行条件
8484
rows = cut.FindAll(".qb-row");

0 commit comments

Comments
 (0)