lablup / lablup/backend.ai-webui

test: cover the /applauncher already-logged-in fast path with an existing session_id (cluster-backed)

Open
#9,488 0 comments 0 reactions 0 assignees View on GitHub
test
Dominant language
TypeScript
Stars
133
Forks
81
Avg merge
1d 12h
Merged PRs (30d)
355

Description

Follow-up to #5850 (case 1), split out of #9465.

#9465 covered only case 4 of #5850 (missing required params), and only the missing-`sToken` half of it. Case 1 is **feasible today** — it is not blocked by any client-side limitation — but it needs a live Backend.AI cluster, which was not available in the environment #9465 was written in. Filing it so the case does not silently drop out of tracking.

## What to test

Navigate to `/applauncher?session_id=&app=&…` **while already logged in**, and assert the app-proxy URL is resolved and the redirect occurs.

## Why it works without an sToken

- `STokenLoginBoundary` has an explicit already-logged-in fast path: `alreadyLoggedIn = !!(await client.check_login())`, and the missing-token guard is `!alreadyLoggedIn && !sToken`.
- `EduAppLauncher` accepts `sToken?: string | null`.
- `EduAppLauncher.tsx:713` (Path A, `const sessionId = extraParams.session_id || null`) never reads `sToken` at all.

So `loginAsUser(page, request)` + a real session + `/applauncher?session_id=&app=…` exercises the whole path with no need to mint an sToken.

## Shape to follow

`e2e/app-launcher/app-launcher-launch.spec.ts:79` already sets up a real session for a launch test — reuse that shape, including its existing guards (serial mode, no-agent / timeout skip).

## Prerequisites

- Running Backend.AI cluster with agent capacity.

## Related

- Parent issue: #5850
- Slice already open: #9465
- Sibling follow-up (case 2, session-template creation): #9490

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with e2e/app-launcher/app-launcher-launch.spec.ts:79 and follow its real-session setup, including the serial-mode and no-agent/timeout guards. Run the launch test against a Backend.AI cluster with agent capacity, using loginAsUser(page, request) before navigating to /applauncher with session_id and app parameters. Done means the app-proxy URL is resolved and the redirect is asserted for an already-logged-in session.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.