Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 committed Aug 14, 2024
1 parent 0d20e00 commit 77f3773
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
26 changes: 17 additions & 9 deletions e2e/fixtures/page-type-home/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ hero:
text: E2E case subTitle
tagline: E2E case tagline
actions:
- text: Action 1
link: /action-1
- text: Action 2
link: /action-2
theme: brand
- text: External
link: https://example.com/
theme: alt
- text: Action 1
link: /action-1
- text: Action 2
link: /action-2
theme: brand
- text: External
link: https://example.com/
theme: alt
image:
src: /brand.png
alt: E2E case brand image
Expand All @@ -21,5 +21,13 @@ hero:
- /[email protected] 2x
sizes:
- '((min-width: 50em) and (max-width: 60em)) 50em'
- "(max-width: 30em) 20em"
- '(max-width: 30em) 20em'
features:
- title: Blazing fast build speed
details: The core compilation module is based on the Rust front-end toolchain, providing a more ultimate development experience.
icon: 🏃🏻‍♀️
- title: Support for MDX content writing
details: MDX is a powerful way to write content, allowing you to use React components in Markdown.
icon: 📦
link: https://example.com/
---
13 changes: 13 additions & 0 deletions e2e/tests/page-type-home.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,17 @@ test.describe('home pageType', async () => {

// todo: add tests for hero actions
});

test('Features', async ({ page }) => {
await page.goto(`http://localhost:${appPort}`);
const features = await page.$$('.rspress-home-feature-card');
expect(features).toHaveLength(2);

const url1 = page.url();
await features[0].click();
expect(page.url()).toBe(url1);

await features[1].click();
expect(page.url()).toBe('https://example.com/');
});
});

0 comments on commit 77f3773

Please sign in to comment.