You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,9 @@ The following section list all changes in 1.0.0 preview 01.
11
11
### Added
12
12
List of new features.
13
13
14
-
- Added support for triggering `@ontoggle` event handlers through a dedicated `Toggle()` method. By [@egil](https://github.com/egil) in [#248](https://github.com/egil/bUnit/pull/248).
14
+
- Added support for triggering `@ontoggle` event handlers through a dedicated `Toggle()` method. By [@egil](https://github.com/egil) in [#256](https://github.com/egil/bUnit/pull/256).
15
+
16
+
- Added out of the box support for `<Virtualize>` component. When a `<Virtualize>` component is used in a component under test, it's JavaScript interop-calls are faked by bUnits JSInterop, and it should result in all items being rendered immediately.
15
17
16
18
### Changed
17
19
List of changes in existing functionality.
@@ -24,6 +26,13 @@ List of changes in existing functionality.
24
26
25
27
Learn more [issue #237](https://github.com/egil/bUnit/issues/237). By [@egil](https://github.com/egil) in [#247](https://github.com/egil/bUnit/pull/247).
26
28
29
+
- The `Setup<TResult>(string identifier, Func<IReadOnlyList<object?>, bool> argumentsMatcher)` and `SetupVoid(string identifier, Func<IReadOnlyList<object?>, bool> argumentsMatcher)` methods in bUnits JSInterop/MockJSRuntime has a new second parameter, an `InvocationMatcher`.
30
+
31
+
The `InvocationMatcher` type is a delegate that receives a `JSRuntimeInvoation` and returns true. The `JSRuntimeInvoation` type contains the arguments of the invocation and the identifier for the invocation. This means old code using the `Setup` and `SetupVoid` methods should be updated to use the arguments list in `JSRuntimeInvoation`, e.g., change the following call:
32
+
33
+
`ctx.JSInterop.Setup<string>("foo", args => args.Count == 2)` to this:
/// Configure a JSInterop invocation handler with the <paramref name="identifier"/> and arguments
63
-
/// passing the <paramref name="argumentsMatcher"/> test.
61
+
/// passing the <paramref name="invocationMatcher"/> test.
64
62
/// </summary>
65
63
/// <typeparam name="TResult">The result type of the invocation.</typeparam>
66
64
/// <param name="identifier">The identifier to setup a response for.</param>
67
-
/// <param name="argumentsMatcher">A matcher that is passed arguments received in invocations to <paramref name="identifier"/>. If it returns true the invocation is matched.</param>
65
+
/// <param name="invocationMatcher">A matcher that is passed an <see cref="JSRuntimeInvocation"/> associated with the<paramref name="identifier"/>. If it returns true the invocation is matched.</param>
/// Configure a JSInterop invocation handler with the <paramref name="identifier"/> and arguments
92
-
/// passing the <paramref name="argumentsMatcher"/> test, that should not receive any result.
88
+
/// passing the <paramref name="invocationMatcher"/> test, that should not receive any result.
93
89
/// </summary>
94
90
/// <param name="identifier">The identifier to setup a response for.</param>
95
-
/// <param name="argumentsMatcher">A matcher that is passed arguments received in invocations to <paramref name="identifier"/>. If it returns true the invocation is matched.</param>
91
+
/// <param name="invocationMatcher">A matcher that is passed an <see cref="JSRuntimeInvocation"/> associated with the<paramref name="identifier"/>. If it returns true the invocation is matched.</param>
0 commit comments