Skip to content

Commit

Permalink
enable e2e mode dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
yandzee committed Feb 21, 2024
1 parent fa148ac commit 956a2b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 0 additions & 6 deletions .github/cilium-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ hubble:
value: /var/log/hubble-ui-testing/log_files
- name: CORS_ENABLED
value: 'true'
frontend:
extraEnv:
- name: E2E_TEST_MODE
value: 'true'
- name: NODE_ENV
value: 'e2e'
ingress:
enabled: true
className: nginx
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const run = async () => {
app
.onBeforeMount(_app => {
const env = app.environment;
e2e.attributes.setEnabled(env.isDev || env.isTesting);
e2e.attributes.setEnabled(router.mockModeParam != null);
uiLayer.onBeforeMount();
})
.onMounted(app => app.uiLayer.onMounted())
Expand Down
4 changes: 4 additions & 0 deletions src/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export class Router extends EventEmitter<Handlers> {
this.setupEventHandlers();
}

public get mockModeParam() {
return this.searchParams.get('e2e');
}

public get isInMemory() {
return this.kind === RouterKind.Memory;
}
Expand Down

0 comments on commit 956a2b8

Please sign in to comment.