Skip to content

Commit c9c64a8

Browse files
committed
ent test fixes
1 parent 7024bdc commit c9c64a8

File tree

3 files changed

+33
-25
lines changed

3 files changed

+33
-25
lines changed

e2e/questdb

Submodule questdb updated 85 files

e2e/tests/enterprise/oidc.spec.js

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,16 @@ describe("OIDC", () => {
6767

6868
it("should login via OIDC", () => {
6969
interceptAuthorizationCodeRequest(`${baseUrl}?code=abcdefgh`);
70-
cy.getByDataHook("button-sso-login").click();
71-
cy.wait("@authorizationCode");
72-
7370
interceptTokenRequest({
7471
"access_token": "gslpJtzmmi6RwaPSx0dYGD4tEkom",
7572
"refresh_token": "FUuAAqMp6LSTKmkUd5uZuodhiE4Kr6M7Eyv",
7673
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6I",
7774
"token_type": "Bearer",
7875
"expires_in": 300
7976
});
80-
cy.wait("@tokens");
77+
cy.getByDataHook("button-sso-login").click();
78+
cy.wait("@authorizationCode");
79+
8180
cy.getEditor().should("be.visible");
8281

8382
cy.executeSQL("select current_user();");
@@ -88,15 +87,15 @@ describe("OIDC", () => {
8887

8988
it("should request a new token on page reload, even if there is no refresh token", () => {
9089
interceptAuthorizationCodeRequest(`${baseUrl}?code=abcdefgh`);
91-
cy.getByDataHook("button-sso-login").click();
92-
cy.wait("@authorizationCode");
93-
9490
interceptTokenRequest({
9591
"access_token": "gslpJtzmmi6RwaPSx0dYGD4tEkom",
9692
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6I",
9793
"token_type": "Bearer",
9894
"expires_in": 0
9995
});
96+
cy.getByDataHook("button-sso-login").click();
97+
cy.wait("@authorizationCode");
98+
10099
cy.wait("@tokens");
101100
cy.getEditor().should("be.visible");
102101

@@ -106,16 +105,16 @@ describe("OIDC", () => {
106105

107106
it("should not force SSO re-authentication with 'Continue as <username>' button", () => {
108107
interceptAuthorizationCodeRequest(`${baseUrl}?code=abcdefgh`);
109-
cy.getByDataHook("button-sso-login").click();
110-
cy.wait("@authorizationCode");
111-
112108
interceptTokenRequest({
113109
"access_token": "gslpJtzmmi6RwaPSx0dYGD4tEkom",
114110
"refresh_token": "FUuAAqMp6LSTKmkUd5uZuodhiE4Kr6M7Eyv",
115111
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6I",
116112
"token_type": "Bearer",
117113
"expires_in": 300
118114
});
115+
cy.getByDataHook("button-sso-login").click();
116+
cy.wait("@authorizationCode");
117+
119118
cy.wait("@tokens");
120119
cy.getEditor().should("be.visible");
121120

@@ -137,16 +136,16 @@ describe("OIDC", () => {
137136

138137
it("should force SSO re-authentication with 'Choose a different account' button", () => {
139138
interceptAuthorizationCodeRequest(`${baseUrl}?code=abcdefgh`);
140-
cy.getByDataHook("button-sso-login").click();
141-
cy.wait("@authorizationCode");
142-
143139
interceptTokenRequest({
144140
"access_token": "gslpJtzmmi6RwaPSx0dYGD4tEkom",
145141
"refresh_token": "FUuAAqMp6LSTKmkUd5uZuodhiE4Kr6M7Eyv",
146142
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6I",
147143
"token_type": "Bearer",
148144
"expires_in": 300
149145
});
146+
cy.getByDataHook("button-sso-login").click();
147+
cy.wait("@authorizationCode");
148+
150149
cy.wait("@tokens");
151150
cy.getEditor().should("be.visible");
152151

@@ -168,16 +167,16 @@ describe("OIDC", () => {
168167

169168
it("display import panel", () => {
170169
interceptAuthorizationCodeRequest(`${baseUrl}?code=abcdefgh`);
171-
cy.getByDataHook("button-sso-login").click();
172-
cy.wait("@authorizationCode");
173-
174170
interceptTokenRequest({
175171
"access_token": "gslpJtzmmi6RwaPSx0dYGD4tEkom",
176172
"refresh_token": "FUuAAqMp6LSTKmkUd5uZuodhiE4Kr6M7Eyv",
177173
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6I",
178174
"token_type": "Bearer",
179175
"expires_in": 300
180176
});
177+
cy.getByDataHook("button-sso-login").click();
178+
cy.wait("@authorizationCode");
179+
181180
cy.wait("@tokens");
182181
cy.getEditor().should("be.visible");
183182

@@ -225,16 +224,16 @@ describe("OIDC", () => {
225224

226225
it("should login via OIDC with state required", () => {
227226
interceptAuthorizationCodeRequest(`${baseUrl}?code=abcdefgh`);
228-
cy.getByDataHook("button-sso-login").click();
229-
cy.wait("@authorizationCode");
230-
231227
interceptTokenRequest({
232228
"access_token": "gslpJtzmmi6RwaPSx0dYGD4tEkom",
233229
"refresh_token": "FUuAAqMp6LSTKmkUd5uZuodhiE4Kr6M7Eyv",
234230
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6I",
235231
"token_type": "Bearer",
236232
"expires_in": 300
237233
});
234+
cy.getByDataHook("button-sso-login").click();
235+
cy.wait("@authorizationCode");
236+
238237
cy.wait("@tokens");
239238
cy.getEditor().should("be.visible");
240239

@@ -251,16 +250,16 @@ describe("OIDC", () => {
251250

252251
it("should login via OIDC, then admin, then OIDC again without re-authenticating if the OAuth2 provider session is still alive", () => {
253252
interceptAuthorizationCodeRequest(`${baseUrl}?code=abcdefgh`);
254-
cy.getByDataHook("button-sso-login").click();
255-
cy.wait("@authorizationCode");
256-
257253
interceptTokenRequest({
258254
"access_token": "gslpJtzmmi6RwaPSx0dYGD4tEkom",
259255
"refresh_token": "FUuAAqMp6LSTKmkUd5uZuodhiE4Kr6M7Eyv",
260256
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6I",
261257
"token_type": "Bearer",
262258
"expires_in": 300
263259
});
260+
cy.getByDataHook("button-sso-login").click();
261+
cy.wait("@authorizationCode");
262+
264263
cy.wait("@tokens");
265264
cy.getEditor().should("be.visible");
266265

vite.config.mts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ export default defineConfig(({ mode }) => {
4646
changeOrigin: true,
4747
rewrite: (path: string) => `${contextPath}${path}`,
4848
},
49+
"/userinfo": {
50+
bypass: function (_, res) {
51+
res.writeHead(200, { 'Content-Type': 'application/json' })
52+
res.end(JSON.stringify({
53+
sub: "john doe",
54+
groups: ["group1", "group2"]
55+
}))
56+
}
57+
}
4958
}
5059

5160
return {
@@ -130,13 +139,13 @@ export default defineConfig(({ mode }) => {
130139
},
131140

132141
server: {
133-
host: 'localhost',
142+
host: '127.0.0.1',
134143
port: 9999,
135144
proxy: proxySettings,
136145
},
137146

138147
preview: {
139-
host: 'localhost',
148+
host: '127.0.0.1',
140149
port: 9999,
141150
proxy: proxySettings,
142151
},

0 commit comments

Comments
 (0)