File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Blazor/testassets/Wasm.Authentication.Client/Pages Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 2323
2424@if (AccessToken != null )
2525{
26- <h2 >Current time : @DateTimeOffset.Now </h2 >
2726 <h2 >Access token expires </h2 >
28- <p >@AccessToken.Expires </p >
27+ <p >Current time : <span id =" current-time" >@DateTimeOffset.Now </span ></p >
28+ <p id =" access-token-expires" >@AccessToken.Expires </p >
2929
3030 <h2 >Access token granted scopes (as reported by the API )</h2 >
3131 @foreach ( var scope in AccessToken .GrantedScopes )
Original file line number Diff line number Diff line change @@ -158,6 +158,11 @@ public void AuthenticatedUser_ProfileIncludesDetails_And_AccessToken()
158158 "Wasm.Authentication.ServerAPI"
159159 } ,
160160 payload . Scopes ) ;
161+
162+ var currentTime = DateTimeOffset . Parse ( Browser . Exists ( By . Id ( "current-time" ) ) . Text ) ;
163+ var tokenExpiration = DateTimeOffset . Parse ( Browser . Exists ( By . Id ( "access-token-expires" ) ) . Text ) ;
164+ Assert . True ( currentTime . AddMinutes ( 50 ) < tokenExpiration ) ;
165+ Assert . True ( currentTime . AddMinutes ( 60 ) >= tokenExpiration ) ;
161166 }
162167
163168 [ Fact ]
You can’t perform that action at this time.
0 commit comments