fix(cloud): request automatic Space launch (#2501)

Co-authored-by: dadachann <185672915+dadachann@users.noreply.github.com>
This commit is contained in:
Hyu
2026-09-03 11:44:32 +08:00
committed by GitHub
parent c8d8b1aac4
commit d50957fc4f
3 changed files with 19 additions and 3 deletions
@@ -71,7 +71,9 @@ async def space_oauth_api():
application.space_service.get_oauth_authorize_url = Mock(
side_effect=lambda redirect_uri, state: f'https://space.example/authorize?state={state}'
)
application.space_service.get_cloud_entry_url = Mock(return_value='https://space.example/cloud?environment=beta')
application.space_service.get_cloud_entry_url = Mock(
return_value='https://space.example/cloud?environment=beta&auto_launch=1'
)
application.space_service.exchange_oauth_code = AsyncMock(
return_value={
'access_token': 'space-access-token',
@@ -143,7 +145,9 @@ async def test_cloud_login_entry_redirects_to_space_workspace_launcher(space_oau
)
assert response.status_code == 200
assert (await response.get_json())['data']['authorize_url'] == ('https://space.example/cloud?environment=beta')
assert (await response.get_json())['data']['authorize_url'] == (
'https://space.example/cloud?environment=beta&auto_launch=1'
)
application.space_service.get_cloud_entry_url.assert_called_once_with()
application.user_service.issue_space_oauth_state.assert_not_awaited()