Skip to content

Commit cc5561a

Browse files
committed
refactor: adjust test to account for randomly generated state value.
1 parent 10f39bb commit cc5561a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

web/test/api.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ describe("getGlobusConsentURL", function () {
6565
requested_scopes,
6666
query_params: "{}",
6767
});
68+
69+
// Check that state exists and matches the format generated by generateState
70+
expect(options.data.state).to.be.a("string");
71+
expect(options.data.state).to.match(/^[0-9a-f]{32}$/); // 16 bytes -> 32 hex chars
72+
6873
options.success({ consent_url: "http://example.com" });
6974
});
7075

0 commit comments

Comments
 (0)