-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performing a Click()
on a Table Cell does not fire the onclick
method in the page
#399
Comments
|
As requested: |
Hi @Smurf-IV, Just tested locally, and when stepping through the code, I see that the
Both of these elements have an onclick event handler bound to them. Your assertions fail though, but that seems to be related to code in the DataGrid component. public async Task Test1()
{
using var cut = RenderComponent<DataGrider.Component1>();
cut.WaitForState(() => cut.Instance.IsInitialised, 10.Seconds());
// Now wait for the final StateChange to populate the page layout.
cut.WaitForAssertion(() => cut.Find(@"button"), 10.Seconds());
var useSelectedBtn = cut.Find(@"button");
useSelectedBtn.HasAttribute(@"disabled").Should().BeTrue();
var cells = cut.FindAll("table tr td:nth-child(1)");
var cellLast = cells[cells.Count - 1];
cellLast.Click(); // <-- this triggers the event handlers
useSelectedBtn.HasAttribute(@"disabled").Should().BeFalse();
} Unrelated: The test example you shared will reuse a TestContext with all tests due to how NUnit work. That will work in some cases, but is not supported in all cases. See https://bunit.dev/docs/getting-started/writing-tests.html#remove-boilerplate-code-from-tests-1 for the proper way to inherit from TestContext in your NUnit tests. |
@Smurf-IV do you still believe this is a bug in bUnit? Otherwise I will convert this issue to a discussion to keep the issues list clean. |
I do not know. The code works when it is run in a browser (i.e. the selectedItem is Not null and therefore the button is enabled.)
Blame / bug cannot be allocated to any of the above yet! |
OK. Well, Im very confident that Its still not clear to me what you expect should happen when you trigger the |
In the Code included , the following line means that the
So could it be option 3 ? |
Not sure. How are you asserting that a selected row is set? |
In the code |
I might be going blind, but i don't see that in any of the messages here or in the sample you posted. Can you add a test with the expected assertion added that is failing? |
You can put it into the Test code explicitly,
|
I looked at the code for DataGrid.cs, and its not clear to me how it goes from clicking a row to raising the RowSelectedChanged event callback. Perhaps @stsrki can enlighten us. |
It is handled by the TableRow Clicked event( |
Thanks @stsrki. If there any JavaScript involved? I can see the event is being correctly triggered by bunit, and it is a pretty basic thing to do in tests, so not sure if this is a corner case or the premise/assertion is wrong. |
Now that you mentioned it, there might be some javascript involved. Recently one of our community members implemented column resizing and by quick looking at the code, it has some |
|
@Smurf-IV not sure what's going on tbh. If we have bUnits JSInterop in strict mode, it only fails the test if some an seemingly unrelated JS call is not configured. I will have to debug with Blazorise's source code locally to figure out what is going on. Unfortunately I am sort on time these days, so I cannot promise an answer soon. Maybe the Blazorise folks have time to look into this? |
I would really like to help but I'm also too overworked lately. Can't promise anything yet. |
I've actually run into something similar here. After some testing the problem is that it does not execute onclick if there is a reference to a local variable. Stripping it down to the simplest test: This sort of local variable reference works fine with hosted blazor instead of bunit. Using bunit 1.2.36-preview |
@isulzer this is definitely something that should work. Can you do me a favor and show a complete component and the accompanying test that fails. |
I tried to recreate this on my home PC and it's working fine. Not allowed to upload the other. Will try to figure out the difference... |
Ah took me a bit to notice it was the second click that had the issue. Notice the first Click() printed to console, but the second one does not. Attached a test with it replicated |
After some further testing, this occurs with any event - for example onchange - that has an anonymous method and a captured local variable. The first call will work. the second will never fire. |
That makes sense, since all the |
I'm going to investigate further ASAP. Thanks for the sample @isulzer. |
OK @isulzer, @Smurf-IV, I know whats going on now. Consider this component: @code
{
[Parameter] public IList<string> Items { get; set; }
}
<table>
@for (var i = 0; i < Items.Count; i++)
{
var row = Items[i];
var index = i + 1;
<tr @onclick="@(() =>
{
Console.WriteLine($"Index is {index}");
})">
<td>row @row</td>
</tr>
}
</table> and this test: [Theory, AutoData]
public void TestMethod1(IList<string> data)
{
var cut = RenderComponent<InlineEventHandlers>(ps => ps.Add(p => p.Items, data));
var rows = cut.FindAll("tr");
var row1 = rows.ElementAt(0);
row1.Click();
//second click does not work
//but if you change the razor console.writeline to not reference index then it works
row1 = rows.ElementAt(0);
row1.Click();
var row2 = rows.ElementAt(1);
row2.Click();
Console.WriteLine("End test");
} On the line However, this was very hard to notice because the bUnit would actually swallow an exception thrown by Blazor related to this, so I will be changing bUnit for the next release, so this should not happen again. The workaround for this is to requery the DOM tree after each time you cause a component to rerender, e.g. when triggering an event by calling |
Ah! Makes sense. Thank you so much. Workaround works for me. |
But in my test code, I never even got the first click to be actioned.. |
It might, if your components do some async triggered renders. Try your test with the |
@Smurf-IV, also, try adding logging to the test runner, as described here: https://bunit.dev/docs/misc-test-tips.html#capturing-logs-from-ilogger-in-test-output This will give us insight into what is going on in the renderer. |
This will have to wait a few days, but I'll get to the test eventually |
FYI: This keeps slipping down the backlog.. Hope to catch it soon. |
No worries @Smurf-IV. There is a fix released that could solve this, or at least bring some light to where the issue comes from, so I look forward to see if that solves it for you. |
Hello! any update? for me it does not work also (.Click() on tr/td of Blazorise's DataGrid) please type here when it is fixed/resolved or you have any workaround |
@andz-gl if you are seeing something similar, please contribute a minimal reproducible sample that we can use to troubleshot this. |
hope it could help, here is pseudocode:
after that nothing happens (datagrid's row is not expanded, internal elements are not accessible even via 'WaitForAssertion') |
Can you share something (as simple/minimal as possible) I can download and run myself. Otherwise its hard to help. |
'span.hfghjgfjhkg' should be visible/accessible via cut.Find("span.hfghjgfjhkg") after tableRow.Click() but it's not the case :( |
@andz-gl as an experiment, I tried changing your @page "/test-component"
@using Blazorise.DataGrid
@using WebApplication1.Data
@inject WeatherForecastService ForecastService
<h3>TestComponent</h3>
<DataGrid TItem="WeatherForecast"
Data="@forecasts"
@bind-SelectedRow="@selectedForecast"
DetailRowTrigger="@((item)=>
{
TriggerCount++;
return item.Date == selectedForecast?.Date;
})">
<DataGridColumns>
<DataGridColumn TItem="WeatherForecast" Field="@nameof(WeatherForecast.Date)" />
<DataGridColumn TItem="WeatherForecast" Field="@nameof(WeatherForecast.TemperatureC)" />
</DataGridColumns>
<DetailRowTemplate>
<span class="hfghjgfjhkg">@context.Summary</span>
</DetailRowTemplate>
</DataGrid>
@code {
private WeatherForecast[] forecasts;
private WeatherForecast selectedForecast;
public int TriggerCount { get; set; }
protected override async Task OnInitializedAsync()
{
forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
}
} Now the following test passes: [Test]
public void TestNotOk()
{
// Arrange
using var ctx = new Bunit.TestContext();
ctx.Services.AddBlazorise().AddBootstrapProviders().AddFontAwesomeIcons().AddSingleton<WeatherForecastService>();
// Act
var cut = ctx.RenderComponent<TestComponent>();
var tableRow = cut.Find("tr.table-row-selectable");
tableRow.Click();
// Assert
Assert.AreEqual(20, cut.Instance.TriggerCount);
} So, maybe @stsrki can help out with further debugging, perhaps by stepping into the Blazorize code and provide some insights into why a rerender does not happen like it does in the browser. What triggers a render after a row is clicked? Is it one of the top level services or a root component? Another thing I tried was to add logging to the test project (and convert it to xUnit because thats what I know), reduce the number of weatherforecasts to 1 instead of 5, and captured the verbose logs from the Blazor and bUnit renderer, to see what components was being rendered at what time. As far as I can see, there are no new components being rendered out after the Here is the output: 10:14:50.303 Debug - Initializing root component 0 ("Bunit.Rendering.WrapperComponent")
10:14:50.480 Debug - Processing pending renders.
10:14:50.480 Debug - Rendering component 0 of type "Bunit.Rendering.WrapperComponent"
10:14:50.486 Debug - Initializing component 1 ("Bunit.Rendering.FragmentContainer") as child of "Bunit.Rendering.WrapperComponent" ("Bunit.Rendering.WrapperComponent")
10:14:50.486 Debug - Rendering component 1 of type "Bunit.Rendering.FragmentContainer"
10:14:50.488 Debug - Initializing component 2 ("WebApplication1.Pages.TestComponent") as child of "Bunit.Rendering.FragmentContainer" ("Bunit.Rendering.FragmentContainer")
10:14:50.489 Debug - Rendering component 2 of type "WebApplication1.Pages.TestComponent"
10:14:50.493 Debug - Initializing component 3 ("Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]") as child of "WebApplication1.Pages.TestComponent" ("WebApplication1.Pages.TestComponent")
10:14:50.496 Debug - Rendering component 3 of type "Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]"
10:14:50.496 Debug - Initializing component 4 ("Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]") as child of "Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]" ("Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]")
10:14:50.496 Debug - Initializing component 5 ("Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]") as child of "Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]" ("Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]")
10:14:50.496 Debug - Rendering component 4 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]"
10:14:50.498 Debug - Initializing component 6 ("Blazorise.Table") as child of "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]" ("Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]")
10:14:50.500 Debug - Rendering component 5 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]"
10:14:50.504 Debug - Initializing component 7 ("Blazorise.DataGrid.DataGridColumn`1[WebApplication1.Data.WeatherForecast]") as child of "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]" ("Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]")
10:14:50.506 Debug - Initializing component 8 ("Blazorise.DataGrid.DataGridColumn`1[WebApplication1.Data.WeatherForecast]") as child of "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]" ("Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]")
10:14:50.507 Debug - Rendering component 6 of type "Blazorise.Table"
10:14:50.507 Debug - Initializing component 9 ("Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.Table]") as child of "Blazorise.Table" ("Blazorise.Table")
10:14:50.507 Debug - Rendering component 7 of type "Blazorise.DataGrid.DataGridColumn`1[WebApplication1.Data.WeatherForecast]"
10:14:50.507 Debug - Rendering component 8 of type "Blazorise.DataGrid.DataGridColumn`1[WebApplication1.Data.WeatherForecast]"
10:14:50.507 Debug - Rendering component 9 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.Table]"
10:14:50.510 Debug - Initializing component 10 ("Blazorise.TableHeader") as child of "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.Table]" ("Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.Table]")
10:14:50.517 Debug - Initializing component 11 ("Blazorise.TableBody") as child of "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.Table]" ("Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.Table]")
10:14:50.518 Debug - Rendering component 10 of type "Blazorise.TableHeader"
10:14:50.520 Debug - Initializing component 12 ("Blazorise.TableRow") as child of "Blazorise.TableHeader" ("Blazorise.TableHeader")
10:14:50.521 Debug - Rendering component 11 of type "Blazorise.TableBody"
10:14:50.533 Debug - Initializing component 13 ("Blazorise.DataGrid._DataGridRow`1[WebApplication1.Data.WeatherForecast]") as child of "Blazorise.TableBody" ("Blazorise.TableBody")
10:14:50.534 Debug - Rendering component 12 of type "Blazorise.TableRow"
10:14:50.537 Debug - Initializing component 14 ("Blazorise.TableHeaderCell") as child of "Blazorise.TableRow" ("Blazorise.TableRow")
10:14:50.537 Debug - Initializing component 15 ("Blazorise.TableHeaderCell") as child of "Blazorise.TableRow" ("Blazorise.TableRow")
10:14:50.537 Debug - Rendering component 3 of type "Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]"
10:14:50.537 Debug - Rendering component 13 of type "Blazorise.DataGrid._DataGridRow`1[WebApplication1.Data.WeatherForecast]"
10:14:50.539 Debug - Initializing component 16 ("Blazorise.TableRow") as child of "Blazorise.DataGrid._DataGridRow`1[WebApplication1.Data.WeatherForecast]" ("Blazorise.DataGrid._DataGridRow`1[WebApplication1.Data.WeatherForecast]")
10:14:50.539 Debug - Rendering component 14 of type "Blazorise.TableHeaderCell"
10:14:50.540 Debug - Rendering component 15 of type "Blazorise.TableHeaderCell"
10:14:50.540 Debug - Rendering component 4 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]"
10:14:50.540 Debug - Rendering component 5 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]"
10:14:50.540 Debug - Rendering component 16 of type "Blazorise.TableRow"
10:14:50.542 Debug - Initializing component 17 ("Blazorise.TableRowCell") as child of "Blazorise.TableRow" ("Blazorise.TableRow")
10:14:50.542 Debug - Initializing component 18 ("Blazorise.TableRowCell") as child of "Blazorise.TableRow" ("Blazorise.TableRow")
10:14:50.542 Debug - Rendering component 6 of type "Blazorise.Table"
10:14:50.542 Debug - Rendering component 17 of type "Blazorise.TableRowCell"
10:14:50.544 Debug - Rendering component 18 of type "Blazorise.TableRowCell"
10:14:50.545 Debug - Rendering component 9 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.Table]"
10:14:50.545 Debug - Rendering component 10 of type "Blazorise.TableHeader"
10:14:50.545 Debug - Rendering component 11 of type "Blazorise.TableBody"
10:14:50.547 Debug - Rendering component 12 of type "Blazorise.TableRow"
10:14:50.547 Debug - Rendering component 13 of type "Blazorise.DataGrid._DataGridRow`1[WebApplication1.Data.WeatherForecast]"
10:14:50.547 Debug - Rendering component 14 of type "Blazorise.TableHeaderCell"
10:14:50.547 Debug - Rendering component 15 of type "Blazorise.TableHeaderCell"
10:14:50.547 Debug - Rendering component 16 of type "Blazorise.TableRow"
10:14:50.547 Debug - Rendering component 17 of type "Blazorise.TableRowCell"
10:14:50.547 Debug - Rendering component 18 of type "Blazorise.TableRowCell"
10:14:50.548 Debug - New render batch received.
10:14:50.548 Debug - Component with ID = 0 has been rendered.
10:14:50.554 Debug - Finished updating components markup.
10:14:50.560 Debug - Rendering component 3 of type "Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]"
10:14:50.560 Debug - Rendering component 4 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]"
10:14:50.560 Debug - Rendering component 5 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]"
10:14:50.560 Debug - Rendering component 6 of type "Blazorise.Table"
10:14:50.560 Debug - Rendering component 9 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.Table]"
10:14:50.560 Debug - Rendering component 10 of type "Blazorise.TableHeader"
10:14:50.560 Debug - Rendering component 11 of type "Blazorise.TableBody"
10:14:50.560 Debug - Rendering component 12 of type "Blazorise.TableRow"
10:14:50.560 Debug - Rendering component 3 of type "Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]"
10:14:50.560 Debug - Rendering component 13 of type "Blazorise.DataGrid._DataGridRow`1[WebApplication1.Data.WeatherForecast]"
10:14:50.560 Debug - Rendering component 14 of type "Blazorise.TableHeaderCell"
10:14:50.560 Debug - Rendering component 15 of type "Blazorise.TableHeaderCell"
10:14:50.560 Debug - Rendering component 4 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]"
10:14:50.560 Debug - Rendering component 5 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]"
10:14:50.560 Debug - Rendering component 16 of type "Blazorise.TableRow"
10:14:50.560 Debug - Rendering component 6 of type "Blazorise.Table"
10:14:50.560 Debug - Rendering component 17 of type "Blazorise.TableRowCell"
10:14:50.560 Debug - Rendering component 18 of type "Blazorise.TableRowCell"
10:14:50.560 Debug - Rendering component 9 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.Table]"
10:14:50.560 Debug - Rendering component 10 of type "Blazorise.TableHeader"
10:14:50.560 Debug - Rendering component 11 of type "Blazorise.TableBody"
10:14:50.560 Debug - Rendering component 12 of type "Blazorise.TableRow"
10:14:50.560 Debug - Rendering component 13 of type "Blazorise.DataGrid._DataGridRow`1[WebApplication1.Data.WeatherForecast]"
10:14:50.560 Debug - Rendering component 14 of type "Blazorise.TableHeaderCell"
10:14:50.560 Debug - Rendering component 15 of type "Blazorise.TableHeaderCell"
10:14:50.560 Debug - Rendering component 16 of type "Blazorise.TableRow"
10:14:50.560 Debug - Rendering component 17 of type "Blazorise.TableRowCell"
10:14:50.560 Debug - Rendering component 18 of type "Blazorise.TableRowCell"
10:14:50.560 Debug - New render batch received.
10:14:50.560 Debug - Component with ID = 0 has been rendered.
10:14:50.560 Debug - Finished updating components markup.
10:14:50.561 Debug - The initial render of 0 is completed.
+ 10:14:50.610 Debug - Handling event { Id: 5, Name: "HandlingEvent" } of type '"MouseEventArgs"'
+ 10:14:50.610 Debug - Processing pending renders.
+ 10:14:50.611 Debug - Rendering component 16 of type "Blazorise.TableRow"
+ 10:14:50.611 Debug - Rendering component 17 of type "Blazorise.TableRowCell"
+ 10:14:50.611 Debug - Rendering component 18 of type "Blazorise.TableRowCell"
+ 10:14:50.611 Debug - New render batch received.
+ 10:14:50.611 Debug - Component with ID = 0 has been rendered.
+ 10:14:50.611 Debug - Component with ID = 1 has been rendered.
+ 10:14:50.611 Debug - Component with ID = 2 has been rendered.
+ 10:14:50.611 Debug - Finished updating components markup.
10:14:50.613 Debug - Checking the wait condition for component 2
10:14:50.613 Debug - The checker of component 2 throw an exception with message 'No elements were found that matches the selector 'span.hfghjgfjhkg''
10:14:50.614 Debug - Checking the wait condition for component 2
10:14:50.614 Debug - The checker of component 2 throw an exception with message 'No elements were found that matches the selector 'span.hfghjgfjhkg''
10:14:51.617 Debug - The wait for helper for component 2 timed out
10:14:51.617 Debug - The state wait helper for component 2 disposed
10:14:51.622 Debug - Disposing component 0 of type "Bunit.Rendering.WrapperComponent"
10:14:51.622 Debug - Disposing component 1 of type "Bunit.Rendering.FragmentContainer"
10:14:51.622 Debug - Disposing component 2 of type "WebApplication1.Pages.TestComponent"
10:14:51.622 Debug - Disposing component 3 of type "Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]"
10:14:51.623 Debug - Disposing component 4 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]"
10:14:51.623 Debug - Disposing component 5 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.DataGrid.DataGrid`1[WebApplication1.Data.WeatherForecast]]"
10:14:51.623 Debug - Disposing component 6 of type "Blazorise.Table"
10:14:51.623 Debug - Disposing component 7 of type "Blazorise.DataGrid.DataGridColumn`1[WebApplication1.Data.WeatherForecast]"
10:14:51.623 Debug - Disposing component 8 of type "Blazorise.DataGrid.DataGridColumn`1[WebApplication1.Data.WeatherForecast]"
10:14:51.623 Debug - Disposing component 9 of type "Microsoft.AspNetCore.Components.CascadingValue`1[Blazorise.Table]"
10:14:51.623 Debug - Disposing component 10 of type "Blazorise.TableHeader"
10:14:51.623 Debug - Disposing component 11 of type "Blazorise.TableBody"
10:14:51.623 Debug - Disposing component 12 of type "Blazorise.TableRow"
10:14:51.623 Debug - Disposing component 13 of type "Blazorise.DataGrid._DataGridRow`1[WebApplication1.Data.WeatherForecast]"
10:14:51.623 Debug - Disposing component 14 of type "Blazorise.TableHeaderCell"
10:14:51.623 Debug - Disposing component 15 of type "Blazorise.TableHeaderCell"
10:14:51.623 Debug - Disposing component 16 of type "Blazorise.TableRow"
10:14:51.623 Debug - Disposing component 17 of type "Blazorise.TableRowCell"
10:14:51.623 Debug - Disposing component 18 of type "Blazorise.TableRowCell" The |
thank you! just shared it on Blazorise discussion thread(about this issue): Megabit/Blazorise#2412 |
Hello,
Any idea why the behaviour is different with BUnit? @egil can you help? Edit: Adding Blazorise's branch test for this issue if you guys need/want to fork/test/debug blazorise. Thanks! |
That explains it. bUnit doesn't set that value by default, but I think it should set it to one when you call Luckily that's an easy fix, e.g. see the Click @David-Moreira would you be so kind to call the method like this to verify that this will work: And thank you for your help debugging this. You and the other people over at the Blazorise team are doing great work! |
That's great, Thanks! We'll let you know if it works as soon as we test it! Edit: nvm there isn't repeated clicking on bunit haha 😆 |
Haha yeah, well, it would be tricky to figure out when users were intending to emulate consecutive clicks or just one click followed by another. This is mostly an issue because the users of Blazorise (and perhaps other 3rd party libs that uses the Users testing their own libs that uses But hopefully I can make folks lives easier by setting more sane
|
Tested. Works great. |
Click(detail: 1) works. Thank you! |
The fix has been merged in to main, so it should be available as a nightly release soon (see how to get it here: #209). |
Just to confirm Click(1) makes things work.. |
if using Async version, below is what you need
|
Describe the bug
Blazorise Datagrid (Not important, just what it is) Create a table, that has
onclick
overrides for each cell.These are then routed through to allow detection of RowChnaged, RowSelecterd, RowClicked, etc methods.
What is needed is a way to simulate a cell click and for those methods to fire to be able to detect changes in the page selected item.
Example:
None of these work.
With this test:
Version info:
The text was updated successfully, but these errors were encountered: