mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 17:23:25 +00:00
FIX - connect marketplace media workflows
This commit is contained in:
@@ -31,4 +31,31 @@ describe('message media handoff', () => {
|
||||
expect(store.request).toMatchObject({ mediaType: 'video', target: '4205550196' })
|
||||
expect(store.cancel()).toBe('/apps/messages')
|
||||
})
|
||||
|
||||
it('returns multiple photos and the requesting app context', () => {
|
||||
const store = useMessageMediaStore()
|
||||
const secondPhoto = { ...photo, id: 18 }
|
||||
store.begin('citymarkt:sell', 'photo', '/apps/citymarkt?sell=1', 2, {
|
||||
title: 'Draft listing',
|
||||
})
|
||||
|
||||
expect(store.completeMany([photo, secondPhoto])).toBe('/apps/citymarkt?sell=1')
|
||||
expect(store.consumeMany<{ title: string }>('citymarkt:sell')).toEqual({
|
||||
context: { title: 'Draft listing' },
|
||||
media: [photo, secondPhoto],
|
||||
})
|
||||
})
|
||||
|
||||
it('preserves the requesting app context when selection is cancelled', () => {
|
||||
const store = useMessageMediaStore()
|
||||
store.begin('local-pages:compose', 'photo', '/apps/local-pages?compose=1', 6, {
|
||||
title: 'Draft post',
|
||||
})
|
||||
|
||||
expect(store.cancel()).toBe('/apps/local-pages?compose=1')
|
||||
expect(store.consumeMany<{ title: string }>('local-pages:compose')).toEqual({
|
||||
context: { title: 'Draft post' },
|
||||
media: [],
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user