diff --git a/gui/src/pages/GuidedSetupPage.tsx b/gui/src/pages/GuidedSetupPage.tsx index 17c4a7f..6bbc926 100644 --- a/gui/src/pages/GuidedSetupPage.tsx +++ b/gui/src/pages/GuidedSetupPage.tsx @@ -303,6 +303,7 @@ function BrowserGuidedSetupPage({

Step 1

Playlists

Add every playlist that belongs in the source set. Each item can be a local file or a public HTTPS URL.

+

Links with a password or token in them are not supported yet. Use a file instead.

{playlists.map((source, index) => renderSourceRow(source, 'playlist', index))}
@@ -329,6 +330,7 @@ function BrowserGuidedSetupPage({ return (
{guide.label || 'Guide'} — Apply this guide to: + {playlists.length > 1 && !selection.all && selection.playlistIds.length === 0 && !selection.explicitlyUnbound ?

Choose a playlist for this guide

: null}

{bindingStatus}

{playlists.length > 1 ? : null} {playlists.map((playlist) => )} diff --git a/gui/src/test/guided-setup-browser.test.tsx b/gui/src/test/guided-setup-browser.test.tsx index 13244ef..1aa187d 100644 --- a/gui/src/test/guided-setup-browser.test.tsx +++ b/gui/src/test/guided-setup-browser.test.tsx @@ -214,4 +214,35 @@ describe('browser Guided Setup proposal and acceptance', () => { expect.objectContaining({ playlistRefs: ['playlist-1', expect.stringMatching(/^playlist-2-/)], appliesToAll: false }), ]) }) + + it('says tokenized links are unsupported', () => { + render(()} />) + expect(screen.getByText(/Links with a password or token in them are not supported yet/)).toBeInTheDocument() + }) + + it('does not ask to choose a playlist when there is only one playlist', async () => { + const user = userEvent.setup() + render(()} />) + + await user.upload(screen.getByLabelText('Choose playlist'), new File(['#EXTM3U\n'], 'one.m3u')) + await user.click(screen.getByRole('button', { name: 'Add guide' })) + await user.upload(screen.getByLabelText('Choose guide'), new File([''], 'guide.xml')) + expect(screen.queryByText('Choose a playlist for this guide')).not.toBeInTheDocument() + }) + + it('asks to choose a playlist for a guide with several playlists and no binding yet', async () => { + const user = userEvent.setup() + render(()} />) + + await user.upload(screen.getByLabelText('Choose playlist'), new File(['#EXTM3U\n'], 'one.m3u')) + await user.click(screen.getByRole('button', { name: 'Add another playlist' })) + await user.upload(screen.getAllByLabelText('Choose playlist')[1], new File(['#EXTM3U\n'], 'two.m3u')) + await user.click(screen.getByRole('button', { name: 'Add guide' })) + await user.upload(screen.getByLabelText('Choose guide'), new File([''], 'guide.xml')) + expect(screen.getByText('Choose a playlist for this guide')).toBeInTheDocument() + expect(screen.getByText(/Unbound because no binding decision was supplied/)).toBeInTheDocument() + + await user.click(screen.getByRole('checkbox', { name: 'Playlist 1' })) + expect(screen.queryByText('Choose a playlist for this guide')).not.toBeInTheDocument() + }) })