File tree 3 files changed +13
-1
lines changed
Microsoft.AspNetCore.Components.E2ETest/Tests
testapps/BasicTestApp/RouterTest
3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,17 @@ public void CanFollowLinkToPageWithParameters()
203
203
204
204
var app = MountTestComponent < TestRouter > ( ) ;
205
205
app . FindElement ( By . LinkText ( "With parameters" ) ) . Click ( ) ;
206
+ WaitAssert . Equal ( "Your full name is Abc ." , ( ) => app . FindElement ( By . Id ( "test-info" ) ) . Text ) ;
207
+ AssertHighlightedLinks ( "With parameters" ) ;
208
+
209
+ // Can add more parameters while remaining on same page
210
+ app . FindElement ( By . LinkText ( "With more parameters" ) ) . Click ( ) ;
206
211
WaitAssert . Equal ( "Your full name is Abc McDef." , ( ) => app . FindElement ( By . Id ( "test-info" ) ) . Text ) ;
212
+ AssertHighlightedLinks ( "With parameters" , "With more parameters" ) ;
213
+
214
+ // Can remove parameters while remaining on same page
215
+ app . FindElement ( By . LinkText ( "With parameters" ) ) . Click ( ) ;
216
+ WaitAssert . Equal ( "Your full name is Abc ." , ( ) => app . FindElement ( By . Id ( "test-info" ) ) . Text ) ;
207
217
AssertHighlightedLinks ( "With parameters" ) ;
208
218
}
209
219
Original file line number Diff line number Diff line change 10
10
<li ><NavLink href =" Other" Match =NavLinkMatch.All >Other with base-relative URL (matches all)</NavLink ></li >
11
11
<li ><NavLink href =" /subdir/Other?abc=123" >Other with query</NavLink ></li >
12
12
<li ><NavLink href =" /subdir/Other#blah" >Other with hash</NavLink ></li >
13
- <li ><NavLink href =" /subdir/WithParameters/Name/Abc/LastName/McDef" >With parameters</NavLink ></li >
13
+ <li ><NavLink href =" /subdir/WithParameters/Name/Abc" >With parameters</NavLink ></li >
14
+ <li ><NavLink href =" /subdir/WithParameters/Name/Abc/LastName/McDef" >With more parameters</NavLink ></li >
14
15
</ul >
15
16
16
17
<button onclick =@(x => uriHelper.NavigateTo("Other"))>
Original file line number Diff line number Diff line change
1
+ @page " /WithParameters/Name/{firstName}"
1
2
@page " /WithParameters/Name/{firstName}/LastName/{lastName}"
2
3
<div id =" test-info" >Your full name is @FirstName @LastName. </div >
3
4
<Links />
You can’t perform that action at this time.
0 commit comments