Skip to content

Commit

Permalink
test: use to deep equal
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-elliott committed Jan 2, 2023
1 parent d4115e2 commit fd4ccdc
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cypress/integration/oauth2/refresh_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,21 @@ describe("The OAuth 2.0 Refresh Token Grant", function () {
}).then((originalResponse) => {
expect(originalResponse.status).to.eq(200)
expect(originalResponse.body.refresh_token).to.not.be.empty
expect(originalResponse.body.scope).to.eq("offline_access openid foo bar baz")
expect(originalResponse.body.scope).to.deep.equal(["offline_access", "openid", "foo", "bar", "baz"])

const originalToken = originalResponse.body.refresh_token

cy.refreshTokenBrowserScope(client, originalToken, "offline_access openid foo").then(
(refreshedResponse) => {
cy.refreshTokenBrowserScope(client, originalToken, "offline_access openid foo").then((refreshedResponse) => {
expect(refreshedResponse.status).to.eq(200)
expect(refreshedResponse.body.refresh_token).to.not.be.empty
expect(refreshedResponse.body.scope).to.eq("offline_access openid foo")
expect(refreshedResponse.body.scope).to.deep.equal(["offline_access", "openid", "foo"])

const refreshedToken = refreshedResponse.body.refresh_token

cy.refreshTokenBrowserScope(client, refreshedToken, "offline_access openid foo bar baz").then(
(finalRefreshedResponse) => {
cy.refreshTokenBrowserScope(client, refreshedToken, "offline_access openid foo bar").then((finalRefreshedResponse) => {
expect(finalRefreshedResponse.status).to.eq(200)
expect(finalRefreshedResponse.body.refresh_token).to.not.be.empty
expect(finalRefreshedResponse.body.scope).to.eq("offline_access openid foo bar baz")
expect(finalRefreshedResponse.body.scope).to.deep.equal(["offline_access", "openid", "foo", "bar"])
},
)
},
Expand Down

0 comments on commit fd4ccdc

Please sign in to comment.