mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-20 06:24:06 +01:00
Add tag filter and search test
This commit is contained in:
parent
8d56fbce2f
commit
39bb3c3017
@ -47,7 +47,10 @@ export function ExtendableCard(props: ExtendableCardProps) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="mt-2 flex flex-wrap items-center text-muted-foreground group-hover:hidden">
|
<div className="mt-2 flex flex-wrap items-center text-muted-foreground group-hover:hidden">
|
||||||
{props.tags.map((tag) => (
|
{props.tags.map((tag) => (
|
||||||
<span key={tag} className="text-[10px] md:text-xs rounded-md bg-slate-200 dark:bg-slate-700 p-1 mx-1 mb-1">
|
<span
|
||||||
|
id="tag"
|
||||||
|
key={tag}
|
||||||
|
className="text-[10px] md:text-xs rounded-md bg-slate-200 dark:bg-slate-700 p-1 mx-1 mb-1">
|
||||||
{tag}
|
{tag}
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -4,10 +4,20 @@ test.use({
|
|||||||
storageState: './storageState.json'
|
storageState: './storageState.json'
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test', async ({ page }) => {
|
test('Test search businesses', async ({ page }) => {
|
||||||
await page.goto('http://127.0.0.1:3000/');
|
await page.goto('http://127.0.0.1:3000/');
|
||||||
await page.getByLabel('Main').getByRole('img').click();
|
await page.getByLabel('Main').getByRole('img').click();
|
||||||
await page.getByPlaceholder('Enter business name...').click();
|
|
||||||
await page.getByPlaceholder('Enter business name...').fill('neon');
|
const businessInput = page.getByPlaceholder('Enter business name...');
|
||||||
await page.getByPlaceholder('Enter business name...').press('Enter');
|
await expect(businessInput).toBeVisible();
|
||||||
|
await businessInput.fill('neon');
|
||||||
|
await businessInput.press('Enter');
|
||||||
|
|
||||||
|
const heading = page.getByRole('heading', { name: 'Neon Solution, A dummy company' });
|
||||||
|
await expect(heading).toBeVisible();
|
||||||
|
await heading.click();
|
||||||
|
|
||||||
|
const fundSection = page.locator('div').filter({ hasText: /^Neon raising fund #1$/ });
|
||||||
|
await expect(fundSection).toBeVisible();
|
||||||
|
await fundSection.click();
|
||||||
});
|
});
|
||||||
@ -4,8 +4,27 @@ test.use({
|
|||||||
storageState: './storageState.json'
|
storageState: './storageState.json'
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test', async ({ page }) => {
|
test('Test filter with tags', async ({ page }) => {
|
||||||
await page.goto('http://127.0.0.1:3000/');
|
await page.goto('http://127.0.0.1:3000/');
|
||||||
await page.getByRole('button', { name: 'Start Investing' }).click();
|
await page.getByRole('button', { name: 'Start Investing' }).click();
|
||||||
await page.getByRole('heading', { name: 'Investment Opportunities' }).click();
|
|
||||||
|
await page.locator('button').filter({ hasText: 'Tags' }).click();
|
||||||
|
await page.getByLabel('AI', { exact: true }).click();
|
||||||
|
await page.locator('span#tag', { hasText: 'AI' });
|
||||||
|
|
||||||
|
await page.locator('button').filter({ hasText: 'AI' }).click();
|
||||||
|
await page.getByLabel('Technology').click();
|
||||||
|
await page.locator('span#tag', { hasText: 'Technology' });
|
||||||
|
|
||||||
|
await page.locator('button').filter({ hasText: 'Technology' }).click();
|
||||||
|
await page.getByText('Consumer Electronics').click();
|
||||||
|
await page.locator('span#tag', { hasText: 'Consumer Electronics' });
|
||||||
|
|
||||||
|
await page.locator('button').filter({ hasText: 'Consumer Electronics' }).click();
|
||||||
|
await page.getByLabel('Software').click();
|
||||||
|
await page.locator('span#tag', { hasText: 'Software' });
|
||||||
|
|
||||||
|
await page.locator('button').filter({ hasText: 'Software' }).click();
|
||||||
|
await page.getByLabel('Internet').click();
|
||||||
|
await page.locator('span#tag', { hasText: 'Internet' });
|
||||||
});
|
});
|
||||||
Loading…
Reference in New Issue
Block a user