mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
ui: sample data names Blender and WROLPi, not real channels (#647)
* ui: sample data names Blender, not somebody's channel The gallery, the card samples, and the search fixtures used a real YouTube channel and one of its video titles as demo content. Sample data ships to users and appears in a page linked from Settings; naming a real third party in it puts words in their mouth -- the delete-confirmation sample in particular read "The channel Wranglerstar and its download rules will be removed." Blender fits better anyway: the repo's own test media is Big Buck Bunny, so the sample library now refers to something it actually contains, and to a project that publishes its films for exactly this kind of use. * ui: the second sample channel is WROLPi's own Same reason as the last commit: the remaining sample channel and its video title belonged to a real person. The pair now reads as Blender and WROLPi, which are the two things this project can name freely.
This commit is contained in:
parent
5873e65e8c
commit
499ef435f8
4 changed files with 17 additions and 17 deletions
|
|
@ -455,7 +455,7 @@ describe('SearchResultsInput', () => {
|
|||
const results = {
|
||||
tags: {name: 'Tags', results: [{type: 'tag', title: 'Cooking'}]},
|
||||
videos: {name: 'Videos', results: [
|
||||
{title: 'How To Sharpen An Axe', description: 'Wranglerstar', location: '/videos/1'},
|
||||
{title: 'Big Buck Bunny', description: 'Blender', location: '/videos/1'},
|
||||
]},
|
||||
};
|
||||
|
||||
|
|
@ -470,7 +470,7 @@ describe('SearchResultsInput', () => {
|
|||
handleResultSelect={handleResultSelect}/>);
|
||||
|
||||
await userEvent.click(screen.getByRole('combobox'));
|
||||
await userEvent.click(screen.getByText('How To Sharpen An Axe'));
|
||||
await userEvent.click(screen.getByText('Big Buck Bunny'));
|
||||
|
||||
expect(handleResultSelect).toHaveBeenCalledWith(
|
||||
{result: expect.objectContaining({location: '/videos/1'})});
|
||||
|
|
|
|||
|
|
@ -760,8 +760,8 @@ export function ThemeSamplePage() {
|
|||
channels: {
|
||||
name: 'Channels',
|
||||
results: [
|
||||
{title: 'videos/Wranglerstar', description: 'Wranglerstar'},
|
||||
{title: 'videos/RoseRed Homestead', description: 'RoseRed Homestead'},
|
||||
{title: 'videos/Blender', description: 'Blender'},
|
||||
{title: 'videos/WROLPi', description: 'WROLPi'},
|
||||
],
|
||||
},
|
||||
}}
|
||||
|
|
@ -885,8 +885,8 @@ export function ThemeSamplePage() {
|
|||
<Section label='Cards'>
|
||||
<CardGroup>
|
||||
{[
|
||||
['How To Sharpen An Axe The Right Way', 'Wranglerstar · 2024-11-03', 'blue', 'film'],
|
||||
['Pressure Canning Basics', 'RoseRed Homestead · 2025-02-17', 'blue', 'film'],
|
||||
['Big Buck Bunny', 'Blender · 2024-11-03', 'blue', 'film'],
|
||||
['Getting Started With WROLPi', 'WROLPi · 2025-02-17', 'blue', 'film'],
|
||||
['Water Storage Guide.pdf', 'docs/ · 2025-08-21', 'red', 'file pdf'],
|
||||
['Ham Radio General License.epub', 'ebooks/ · 2024-05-09', 'yellow', 'book'],
|
||||
].map(([title, meta, color, icon]) => <Card
|
||||
|
|
@ -1023,10 +1023,10 @@ export function ThemeSamplePage() {
|
|||
onCancel={() => setConfirmOpen(false)}
|
||||
>
|
||||
<p style={{marginTop: 0}}>
|
||||
The channel <strong>Wranglerstar</strong> and its download rules will be removed.
|
||||
The channel <strong>Blender</strong> and its download rules will be removed.
|
||||
</p>
|
||||
<p style={{color: 'var(--muted)', marginBottom: 0}}>
|
||||
videos/Wranglerstar/ (312 files) will not be deleted.
|
||||
videos/Blender/ (312 files) will not be deleted.
|
||||
</p>
|
||||
</Confirm>
|
||||
|
||||
|
|
|
|||
|
|
@ -2652,8 +2652,8 @@ describe('a card reads as titles, not as a wall of links', () => {
|
|||
it(`keeps a card title legible in ${theme}`, () => {
|
||||
cy.mountUI(<MemoryRouter>
|
||||
<Card title={<a href='/videos/1' className='no-link-underscore card-link'>
|
||||
How To Sharpen An Axe
|
||||
</a>} meta='Wranglerstar'/>
|
||||
Big Buck Bunny
|
||||
</a>} meta='Blender'/>
|
||||
</MemoryRouter>, {theme});
|
||||
|
||||
cy.get('.card-link').should(($link) => {
|
||||
|
|
|
|||
|
|
@ -1365,8 +1365,8 @@ describe('SearchBox', () => {
|
|||
const results = {
|
||||
directories: {name: 'Directories', results: [{title: 'videos/'}]},
|
||||
channels: {name: 'Channels', results: [
|
||||
{title: 'videos/Wranglerstar', description: 'Wranglerstar'},
|
||||
{title: 'videos/RoseRed', description: 'RoseRed Homestead'},
|
||||
{title: 'videos/Blender', description: 'Blender'},
|
||||
{title: 'videos/WROLPi', description: 'WROLPi'},
|
||||
]},
|
||||
};
|
||||
|
||||
|
|
@ -1395,10 +1395,10 @@ describe('SearchBox', () => {
|
|||
onResultSelect={onResultSelect}/>);
|
||||
await userEvent.click(screen.getByRole('combobox'));
|
||||
|
||||
await userEvent.click(screen.getByText('videos/Wranglerstar'));
|
||||
await userEvent.click(screen.getByText('videos/Blender'));
|
||||
|
||||
expect(onResultSelect).toHaveBeenCalledWith(
|
||||
expect.objectContaining({title: 'videos/Wranglerstar'}));
|
||||
expect.objectContaining({title: 'videos/Blender'}));
|
||||
});
|
||||
|
||||
it('moves through suggestions with the arrow keys and takes one with Enter', async () => {
|
||||
|
|
@ -1412,7 +1412,7 @@ describe('SearchBox', () => {
|
|||
await userEvent.keyboard('{ArrowDown}{ArrowDown}{Enter}');
|
||||
|
||||
expect(onResultSelect).toHaveBeenCalledWith(
|
||||
expect.objectContaining({title: 'videos/Wranglerstar'}));
|
||||
expect.objectContaining({title: 'videos/Blender'}));
|
||||
// Enter took the highlighted suggestion instead of submitting the raw text.
|
||||
expect(onSubmit).not.toHaveBeenCalled();
|
||||
});
|
||||
|
|
@ -1426,7 +1426,7 @@ describe('SearchBox', () => {
|
|||
await userEvent.keyboard('{ArrowUp}{Enter}');
|
||||
|
||||
expect(onResultSelect).toHaveBeenCalledWith(
|
||||
expect.objectContaining({title: 'videos/RoseRed'}));
|
||||
expect.objectContaining({title: 'videos/WROLPi'}));
|
||||
});
|
||||
|
||||
it('lets a caller render a suggestion its own way', async () => {
|
||||
|
|
@ -1438,7 +1438,7 @@ describe('SearchBox', () => {
|
|||
|
||||
await userEvent.click(screen.getByRole('combobox'));
|
||||
|
||||
expect(screen.getByText('custom: videos/Wranglerstar').tagName).toBe('EM');
|
||||
expect(screen.getByText('custom: videos/Blender').tagName).toBe('EM');
|
||||
// The default title/description markup is replaced, not wrapped.
|
||||
expect(document.querySelector('.wrolpi-searchbox-result-title')).not.toBeInTheDocument();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue