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 23
23
24
24
@if (AccessToken != null )
25
25
{
26
- <h2 >Current time : @DateTimeOffset.Now </h2 >
27
26
<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 >
29
29
30
30
<h2 >Access token granted scopes (as reported by the API )</h2 >
31
31
@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()
158
158
"Wasm.Authentication.ServerAPI"
159
159
} ,
160
160
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 ) ;
161
166
}
162
167
163
168
[ Fact ]
You can’t perform that action at this time.
0 commit comments