test(36-02): update test fixtures for granular scopes and rebuild embedded admin dist
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
// Unit tests of the MCP consent card (Phase 32.2 UI-SPEC C1) and its UI
|
||||
// backstops: the * rule, no auto-allow, the decision navigation through
|
||||
// window.location.assign (never the router), forbidden redirect schemes, the
|
||||
// switch-account round trip, every C1 state and the focus rules. Fixtures
|
||||
// are neutral acme.* data; no application names appear in framework tests.
|
||||
// Unit tests of the MCP consent card (Phase 32.2 UI-SPEC C1 + Phase 36 C4) and
|
||||
// its UI backstops: 3-tier access control, no auto-allow, the decision
|
||||
// navigation through window.location.assign (never the router), forbidden
|
||||
// redirect schemes, the switch-account round trip, every state and focus rules.
|
||||
// Fixtures are neutral acme.* data; no application names appear in framework tests.
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { enableAutoUnmount, flushPromises, type VueWrapper } from '@vue/test-utils'
|
||||
import { enableAutoUnmount, flushPromises } from '@vue/test-utils'
|
||||
import { setBundle, t } from '../../src/app/i18n'
|
||||
import type { MCPConsent } from '../../src/api/types'
|
||||
import type { AdminAPITokenScope, MCPConsent } from '../../src/api/types'
|
||||
import { currentUser } from '../../src/state/useAuth'
|
||||
import { langFixture } from '../fixtures/typed'
|
||||
import { API, mountApp, notFound, requestsTo, resetState, type Reply, type Route } from '../helpers'
|
||||
@@ -22,9 +22,33 @@ const strings = {
|
||||
'backend::lang.mcp_connect.heading': { other: 'Allow :client to use your account?' },
|
||||
}
|
||||
|
||||
const SCOPE_ALL = { name: '*', label: 'Full access', description: 'Everything you can do.', read_only: false, known: true }
|
||||
const SCOPE_READ = { name: 'admin:read', label: 'Read the admin', description: 'Read every admin list.', read_only: true, known: true }
|
||||
const SCOPE_ACME = { name: 'acme', label: 'Acme', description: 'Use the acme tools.', read_only: false, known: true }
|
||||
const SCOPE_ALL: AdminAPITokenScope = {
|
||||
name: '*',
|
||||
label: 'Full access',
|
||||
description: 'Everything you can do.',
|
||||
read_only: false,
|
||||
known: true,
|
||||
plugin_id: '',
|
||||
group: '',
|
||||
}
|
||||
const SCOPE_READ: AdminAPITokenScope = {
|
||||
name: 'admin:read',
|
||||
label: 'Read the admin',
|
||||
description: 'Read every admin list.',
|
||||
read_only: true,
|
||||
known: true,
|
||||
plugin_id: '',
|
||||
group: '',
|
||||
}
|
||||
const SCOPE_ACME: AdminAPITokenScope = {
|
||||
name: 'acme',
|
||||
label: 'Acme',
|
||||
description: 'Use the acme tools.',
|
||||
read_only: false,
|
||||
known: true,
|
||||
plugin_id: 'acme.blog',
|
||||
group: 'Acme',
|
||||
}
|
||||
|
||||
function consentView(overrides: Partial<MCPConsent> = {}): MCPConsent {
|
||||
return {
|
||||
@@ -40,9 +64,15 @@ function consentView(overrides: Partial<MCPConsent> = {}): MCPConsent {
|
||||
}
|
||||
|
||||
const ok = (data: unknown): Reply => ({ body: { data, meta: {} } })
|
||||
const failure = (status: number, code: string): Reply => ({ status, body: { error: { code, message: code, details: {} } } })
|
||||
const failure = (status: number, code: string): Reply => ({
|
||||
status,
|
||||
body: { error: { code, message: code, details: {} } },
|
||||
})
|
||||
|
||||
function routes(view: MCPConsent | Route = consentView(), decide: Route = ok({ redirect_uri: REDIRECT })): Record<string, Route> {
|
||||
function routes(
|
||||
view: MCPConsent | Route = consentView(),
|
||||
decide: Route = ok({ redirect_uri: REDIRECT }),
|
||||
): Record<string, Route> {
|
||||
return {
|
||||
[`GET ${CONSENT}`]: typeof view === 'function' || 'body' in view ? (view as Route) : ok(view),
|
||||
[`POST ${CONSENT}`]: decide,
|
||||
@@ -71,16 +101,18 @@ async function open(path = '/connect?request=req1', r: Record<string, Route> = r
|
||||
return { ...mounted, push: vi.spyOn(mounted.router, 'push'), replace: vi.spyOn(mounted.router, 'replace') }
|
||||
}
|
||||
|
||||
function boxes(wrapper: VueWrapper) {
|
||||
return wrapper.findAll('[data-scope] input[type="checkbox"]').map((box) => box.element as HTMLInputElement)
|
||||
const pickerDialog = () => document.body.querySelector<HTMLElement>('[data-scope-picker-dialog]')
|
||||
|
||||
async function clickTier(tier: 'full' | 'read_only' | 'custom'): Promise<void> {
|
||||
document.body.querySelector<HTMLElement>(`[data-access-tier="${tier}"]`)?.click()
|
||||
await flushPromises()
|
||||
}
|
||||
|
||||
function box(wrapper: VueWrapper, name: string) {
|
||||
return wrapper.find(`[data-scope="${name}"] input[type="checkbox"]`)
|
||||
}
|
||||
|
||||
async function tick(wrapper: VueWrapper, name: string, on: boolean) {
|
||||
await box(wrapper, name).setValue(on)
|
||||
async function tickPickerScope(name: string, on: boolean): Promise<void> {
|
||||
const input = pickerDialog()!.querySelector<HTMLInputElement>(`[data-scope="${name}"] input[type="checkbox"]`)!
|
||||
input.checked = on
|
||||
input.dispatchEvent(new Event('change', { bubbles: true }))
|
||||
await flushPromises()
|
||||
}
|
||||
|
||||
async function postedBodies(calls: Request[]) {
|
||||
@@ -97,21 +129,28 @@ function expectRouterUntouched(...spies: Array<{ mock: { calls: unknown[][] } }>
|
||||
}
|
||||
|
||||
describe('ready state', () => {
|
||||
it('lists the returned scopes in order with the read-only pill, the host and Stay connected ticked', async () => {
|
||||
it('defaults to Read-only (admin:read) with the read-only pill, the host and Stay connected ticked', async () => {
|
||||
const { wrapper } = await open()
|
||||
const card = wrapper.find('[data-connect-state="ready"]')
|
||||
expect(card.exists()).toBe(true)
|
||||
expect(card.find('h1').text()).toBe('Allow Acme Agent to use your account?')
|
||||
expect(wrapper.findAll('[data-scope]').map((row) => row.attributes('data-scope'))).toEqual(['admin:read', 'acme'])
|
||||
expect(boxes(wrapper).map((b) => b.checked)).toEqual([true, true])
|
||||
expect(wrapper.find('[data-scope="admin:read"]').text()).toContain(t('backend::lang.api_tokens.read_only'))
|
||||
expect(wrapper.find('[data-scope="acme"]').text()).not.toContain(t('backend::lang.api_tokens.read_only'))
|
||||
expect(card.findAll('[data-access-tier]').map((item) => item.attributes('data-access-tier'))).toEqual([
|
||||
'read_only',
|
||||
'custom',
|
||||
])
|
||||
expect(card.find('[data-access-tier="read_only"]').attributes('data-state')).toBe('checked')
|
||||
expect(card.find('[data-scope-summary]').text()).toContain('Read the admin')
|
||||
expect(card.find('[data-scope-summary]').text()).toContain('admin:read')
|
||||
expect(card.find('[data-scope-summary]').text()).toContain(t('backend::lang.api_tokens.read_only'))
|
||||
expect(card.find('[data-connect-host]').text()).toBe('agent.example.test')
|
||||
expect(card.find('[data-connect-admin]').text()).toBe('Dana Dev (dev@example.test)')
|
||||
expect((card.find('[data-connect-offline] input').element as HTMLInputElement).checked).toBe(true)
|
||||
expect(card.find('[data-previously-allowed]').exists()).toBe(false)
|
||||
// Deny on the left, Allow on the right.
|
||||
expect(card.findAll('[data-action="deny"], [data-action="allow"]').map((b) => b.attributes('data-action'))).toEqual(['deny', 'allow'])
|
||||
expect(card.findAll('[data-action="deny"], [data-action="allow"]').map((b) => b.attributes('data-action'))).toEqual([
|
||||
'deny',
|
||||
'allow',
|
||||
])
|
||||
expect(card.find('[data-action="allow"]').attributes('type')).toBe('submit')
|
||||
})
|
||||
|
||||
@@ -153,52 +192,56 @@ describe('ready state', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('the * rule (UI backstop)', () => {
|
||||
it('starts with * unticked, clears and disables the others when ticked, posts ["*"] and re-enables them when unticked', async () => {
|
||||
const { wrapper, calls } = await open('/connect?request=req1', routes(consentView({ scopes: [SCOPE_ALL, SCOPE_READ, SCOPE_ACME] })))
|
||||
expect(boxes(wrapper).map((b) => b.checked)).toEqual([false, true, true])
|
||||
describe('the 3-tier access control & Customize modal (UI backstop)', () => {
|
||||
it('defaults to Read-only when * is also offered, switches to Full (*) with note, and posts ["*"]', async () => {
|
||||
const { wrapper, calls } = await open(
|
||||
'/connect?request=req1',
|
||||
routes(consentView({ scopes: [SCOPE_ALL, SCOPE_READ, SCOPE_ACME] })),
|
||||
)
|
||||
expect(wrapper.find('[data-access-tier="read_only"]').attributes('data-state')).toBe('checked')
|
||||
expect(wrapper.find('[data-scope-all-note]').exists()).toBe(false)
|
||||
|
||||
await tick(wrapper, '*', true)
|
||||
expect(boxes(wrapper).map((b) => b.checked)).toEqual([true, false, false])
|
||||
expect(boxes(wrapper).map((b) => b.disabled)).toEqual([false, true, true])
|
||||
expect(wrapper.find('[data-scope="acme"]').classes()).toContain('cursor-not-allowed')
|
||||
await clickTier('full')
|
||||
expect(wrapper.find('[data-access-tier="full"]').attributes('data-state')).toBe('checked')
|
||||
expect(wrapper.find('[data-scope-all-note]').text()).toBe(t('backend::lang.api_tokens.scope_all_includes'))
|
||||
|
||||
// Unticking * re-enables the others with their previous ticks cleared.
|
||||
await tick(wrapper, '*', false)
|
||||
expect(boxes(wrapper).map((b) => b.checked)).toEqual([false, false, false])
|
||||
expect(boxes(wrapper).map((b) => b.disabled)).toEqual([false, false, false])
|
||||
expect(wrapper.find('[data-scope-all-note]').exists()).toBe(false)
|
||||
expect(wrapper.find('[data-action="allow"]').attributes('disabled')).toBeDefined()
|
||||
|
||||
await tick(wrapper, '*', true)
|
||||
await wrapper.find('[data-connect-state="ready"]').trigger('submit')
|
||||
await flushPromises()
|
||||
expect(await postedBodies(calls)).toEqual([{ decision: 'allow', scopes: ['*'], offline_access: true }])
|
||||
})
|
||||
|
||||
it('ticks * from the start when it is the only scope shown', async () => {
|
||||
it('starts on Full (*) when * is the only scope shown', async () => {
|
||||
const { wrapper } = await open('/connect?request=req1', routes(consentView({ scopes: [SCOPE_ALL] })))
|
||||
expect(boxes(wrapper).map((b) => b.checked)).toEqual([true])
|
||||
expect(wrapper.find('[data-access-tiers]').exists()).toBe(false)
|
||||
expect(wrapper.find('[data-scope-all-note]').exists()).toBe(true)
|
||||
})
|
||||
|
||||
it('posts the ticked names in catalog order and keeps Allow disabled with nothing ticked', async () => {
|
||||
const { wrapper, calls } = await open('/connect?request=req1', routes(consentView({ scopes: [SCOPE_ALL, SCOPE_READ, SCOPE_ACME] })))
|
||||
await tick(wrapper, 'admin:read', false)
|
||||
await tick(wrapper, 'acme', false)
|
||||
const allow = wrapper.find('[data-action="allow"]')
|
||||
expect(allow.attributes('disabled')).toBeDefined()
|
||||
it('opens Custom modal when empty, requires >=1 scope to apply, and posts selected scopes in catalog order', async () => {
|
||||
const { wrapper, calls } = await open(
|
||||
'/connect?request=req1',
|
||||
routes(consentView({ scopes: [SCOPE_ALL, SCOPE_READ, SCOPE_ACME] })),
|
||||
)
|
||||
await clickTier('custom')
|
||||
expect(pickerDialog()).toBeTruthy()
|
||||
expect(pickerDialog()!.querySelector<HTMLButtonElement>('[data-action="scope-picker-apply"]')!.disabled).toBe(true)
|
||||
|
||||
await tickPickerScope('acme', true)
|
||||
const adminRead = pickerDialog()!.querySelector<HTMLInputElement>('[data-admin-read-checkbox]')!
|
||||
adminRead.checked = true
|
||||
adminRead.dispatchEvent(new Event('change', { bubbles: true }))
|
||||
await flushPromises()
|
||||
|
||||
const apply = pickerDialog()!.querySelector<HTMLButtonElement>('[data-action="scope-picker-apply"]')!
|
||||
expect(apply.disabled).toBe(false)
|
||||
apply.click()
|
||||
await flushPromises()
|
||||
expect(pickerDialog()).toBeNull()
|
||||
|
||||
await wrapper.find('[data-connect-state="ready"]').trigger('submit')
|
||||
await flushPromises()
|
||||
expect(requestsTo(calls, 'POST', CONSENT)).toHaveLength(0)
|
||||
await tick(wrapper, 'acme', true)
|
||||
await tick(wrapper, 'admin:read', true)
|
||||
expect(allow.attributes('disabled')).toBeUndefined()
|
||||
await wrapper.find('[data-connect-state="ready"]').trigger('submit')
|
||||
await flushPromises()
|
||||
expect(await postedBodies(calls)).toEqual([{ decision: 'allow', scopes: ['admin:read', 'acme'], offline_access: true }])
|
||||
expect(await postedBodies(calls)).toEqual([
|
||||
{ decision: 'allow', scopes: ['admin:read', 'acme'], offline_access: true },
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -225,14 +268,17 @@ describe('no auto-allow and the decision navigation (UI backstop)', () => {
|
||||
await flushPromises()
|
||||
const [post] = requestsTo(calls, 'POST', CONSENT)
|
||||
expect(post!.headers.get('X-Requested-With')).toBe('XMLHttpRequest')
|
||||
expect(await postedBodies(calls)).toEqual([{ decision: 'allow', scopes: ['admin:read', 'acme'], offline_access: false }])
|
||||
expect(await postedBodies(calls)).toEqual([{ decision: 'allow', scopes: ['admin:read'], offline_access: false }])
|
||||
expect(assign).toHaveBeenCalledTimes(1)
|
||||
expect(assign).toHaveBeenCalledWith(REDIRECT)
|
||||
expectRouterUntouched(push, replace)
|
||||
})
|
||||
|
||||
it('Deny posts the documented body and leaves through window.location.assign', async () => {
|
||||
const { wrapper, calls, push, replace } = await open('/connect?request=req1', routes(consentView(), ok({ redirect_uri: DENIED })))
|
||||
const { wrapper, calls, push, replace } = await open(
|
||||
'/connect?request=req1',
|
||||
routes(consentView(), ok({ redirect_uri: DENIED })),
|
||||
)
|
||||
await wrapper.find('[data-action="deny"]').trigger('click')
|
||||
await flushPromises()
|
||||
expect(await postedBodies(calls)).toEqual([{ decision: 'deny', scopes: [], offline_access: false }])
|
||||
@@ -245,7 +291,7 @@ describe('no auto-allow and the decision navigation (UI backstop)', () => {
|
||||
expect(wrapper.find('[data-connect-offline]').exists()).toBe(false)
|
||||
await wrapper.find('[data-connect-state="ready"]').trigger('submit')
|
||||
await flushPromises()
|
||||
expect(await postedBodies(calls)).toEqual([{ decision: 'allow', scopes: ['admin:read', 'acme'], offline_access: false }])
|
||||
expect(await postedBodies(calls)).toEqual([{ decision: 'allow', scopes: ['admin:read'], offline_access: false }])
|
||||
})
|
||||
|
||||
it('switches to Returning with a continue link for a web URI only', async () => {
|
||||
@@ -258,8 +304,13 @@ describe('no auto-allow and the decision navigation (UI backstop)', () => {
|
||||
expect(wrapper.find('[data-action="allow"]').exists()).toBe(false)
|
||||
expect(document.activeElement).toBe(card.find('h1').element)
|
||||
|
||||
const customView = consentView({ client: { id: 'client-1', name: 'Acme Agent', redirect_host: 'myagent:/callback', logo_url: '' } })
|
||||
const custom = await open('/connect?request=req1', routes(customView, ok({ redirect_uri: 'myagent:/callback?code=1' })))
|
||||
const customView = consentView({
|
||||
client: { id: 'client-1', name: 'Acme Agent', redirect_host: 'myagent:/callback', logo_url: '' },
|
||||
})
|
||||
const custom = await open(
|
||||
'/connect?request=req1',
|
||||
routes(customView, ok({ redirect_uri: 'myagent:/callback?code=1' })),
|
||||
)
|
||||
await custom.wrapper.find('[data-connect-state="ready"]').trigger('submit')
|
||||
await flushPromises()
|
||||
expect(assign).toHaveBeenLastCalledWith('myagent:/callback?code=1')
|
||||
@@ -269,7 +320,9 @@ describe('no auto-allow and the decision navigation (UI backstop)', () => {
|
||||
})
|
||||
|
||||
it('leaves for a redirect whose host matches the shown one as the browser compares hosts', async () => {
|
||||
const view = consentView({ client: { id: 'client-1', name: 'Acme Agent', redirect_host: 'Agent.Example.Test:443', logo_url: '' } })
|
||||
const view = consentView({
|
||||
client: { id: 'client-1', name: 'Acme Agent', redirect_host: 'Agent.Example.Test:443', logo_url: '' },
|
||||
})
|
||||
const { wrapper } = await open('/connect?request=req1', routes(view))
|
||||
await wrapper.find('[data-connect-state="ready"]').trigger('submit')
|
||||
await flushPromises()
|
||||
@@ -313,31 +366,34 @@ describe('submit failures', () => {
|
||||
'https://agent.example.test.evil.example/callback?code=abc123',
|
||||
'https://agent.example.test:8443/callback?code=abc123',
|
||||
'myagent:/callback?code=1',
|
||||
])(
|
||||
'treats the redirect %j as a submit failure',
|
||||
async (uri) => {
|
||||
const { wrapper, push, replace } = await open('/connect?request=req1', routes(consentView(), ok({ redirect_uri: uri })))
|
||||
await wrapper.find('[data-connect-state="ready"]').trigger('submit')
|
||||
await flushPromises()
|
||||
expect(assign).not.toHaveBeenCalled()
|
||||
expect(wrapper.find('[data-connect-state="ready"]').exists()).toBe(true)
|
||||
const alert = wrapper.find('[data-connect-error="decide_failed"]')
|
||||
expect(alert.attributes('role')).toBe('alert')
|
||||
expect(document.activeElement).toBe(alert.element)
|
||||
expect(push).not.toHaveBeenCalled()
|
||||
expect(replace).not.toHaveBeenCalled()
|
||||
},
|
||||
)
|
||||
])('treats the redirect %j as a submit failure', async (uri) => {
|
||||
const { wrapper, push, replace } = await open(
|
||||
'/connect?request=req1',
|
||||
routes(consentView(), ok({ redirect_uri: uri })),
|
||||
)
|
||||
await wrapper.find('[data-connect-state="ready"]').trigger('submit')
|
||||
await flushPromises()
|
||||
expect(assign).not.toHaveBeenCalled()
|
||||
expect(wrapper.find('[data-connect-state="ready"]').exists()).toBe(true)
|
||||
const alert = wrapper.find('[data-connect-error="decide_failed"]')
|
||||
expect(alert.attributes('role')).toBe('alert')
|
||||
expect(document.activeElement).toBe(alert.element)
|
||||
expect(push).not.toHaveBeenCalled()
|
||||
expect(replace).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('422 on Allow shows scopes required and keeps the ticks', async () => {
|
||||
const { wrapper } = await open('/connect?request=req1', routes(consentView(), failure(422, 'no_grantable_scopes')))
|
||||
it('422 on Allow shows scopes required, marks summary invalid and clears on selection change', async () => {
|
||||
const { wrapper } = await open(
|
||||
'/connect?request=req1',
|
||||
routes(consentView({ scopes: [SCOPE_ALL, SCOPE_READ, SCOPE_ACME] }), failure(422, 'no_grantable_scopes')),
|
||||
)
|
||||
await wrapper.find('[data-connect-state="ready"]').trigger('submit')
|
||||
await flushPromises()
|
||||
expect(wrapper.find('[data-connect-error="scopes_required"]').exists()).toBe(true)
|
||||
expect(wrapper.find('[data-scope-picker]').attributes('aria-invalid')).toBe('true')
|
||||
expect(boxes(wrapper).map((b) => b.checked)).toEqual([true, true])
|
||||
// Changing a tick clears the error.
|
||||
await tick(wrapper, 'acme', false)
|
||||
expect(wrapper.find('[data-scope-summary]').attributes('aria-invalid')).toBe('true')
|
||||
expect(wrapper.find('[data-access-tier="read_only"]').attributes('data-state')).toBe('checked')
|
||||
// Changing the selected tier clears the error.
|
||||
await clickTier('full')
|
||||
expect(wrapper.find('[data-connect-error="scopes_required"]').exists()).toBe(false)
|
||||
})
|
||||
|
||||
@@ -367,7 +423,10 @@ describe('submit failures', () => {
|
||||
})
|
||||
|
||||
it('401 on submit expires the session and returns to login with the request', async () => {
|
||||
const { wrapper, router } = await open('/connect?request=req1', routes(consentView(), failure(401, 'unauthenticated')))
|
||||
const { wrapper, router } = await open(
|
||||
'/connect?request=req1',
|
||||
routes(consentView(), failure(401, 'unauthenticated')),
|
||||
)
|
||||
await wrapper.find('[data-connect-state="ready"]').trigger('submit')
|
||||
await flushPromises()
|
||||
expect(currentUser.value).toBeNull()
|
||||
@@ -400,7 +459,10 @@ describe('other states', () => {
|
||||
for (const path of ['/connect', '/connect?request=', '/connect?request=%20']) {
|
||||
const { wrapper, calls } = await open(path)
|
||||
expect(wrapper.find('[data-connect-state="expired"]').exists(), path).toBe(true)
|
||||
expect(calls.filter((request) => new URL(request.url).pathname.startsWith(`${API}/mcp/consent`)), path).toHaveLength(0)
|
||||
expect(
|
||||
calls.filter((request) => new URL(request.url).pathname.startsWith(`${API}/mcp/consent`)),
|
||||
path,
|
||||
).toHaveLength(0)
|
||||
wrapper.unmount()
|
||||
}
|
||||
})
|
||||
@@ -436,10 +498,13 @@ describe('other states', () => {
|
||||
})
|
||||
|
||||
it('offers only Deny, full width, when no scope is grantable', async () => {
|
||||
const { wrapper, calls } = await open('/connect?request=req1', routes(consentView({ scopes: [] }), ok({ redirect_uri: DENIED })))
|
||||
const { wrapper, calls } = await open(
|
||||
'/connect?request=req1',
|
||||
routes(consentView({ scopes: [] }), ok({ redirect_uri: DENIED })),
|
||||
)
|
||||
const card = wrapper.find('[data-connect-state="ready"]')
|
||||
expect(card.find('[data-connect-none-grantable]').attributes('role')).toBe('alert')
|
||||
expect(card.find('[data-scope-picker]').exists()).toBe(false)
|
||||
expect(card.find('[data-scope-summary]').exists()).toBe(false)
|
||||
expect(card.find('[data-connect-offline]').exists()).toBe(false)
|
||||
expect(card.find('[data-action="allow"]').exists()).toBe(false)
|
||||
expect(card.find('[data-action="deny"]').classes()).toContain('flex-1')
|
||||
@@ -456,7 +521,12 @@ describe('other states', () => {
|
||||
const other = `${API}/mcp/consent/req2`
|
||||
const { wrapper, router } = await open('/connect?request=req1', {
|
||||
...routes(),
|
||||
[`GET ${other}`]: ok(consentView({ request_id: 'req2', client: { id: 'c2', name: 'Other Agent', redirect_host: 'other.example.test', logo_url: '' } })),
|
||||
[`GET ${other}`]: ok(
|
||||
consentView({
|
||||
request_id: 'req2',
|
||||
client: { id: 'c2', name: 'Other Agent', redirect_host: 'other.example.test', logo_url: '' },
|
||||
}),
|
||||
),
|
||||
})
|
||||
await router.push('/connect?request=req2')
|
||||
await flushPromises()
|
||||
|
||||
Reference in New Issue
Block a user