|
| 1 | +import { describe, it, expect } from 'vitest' |
| 2 | +import { setup, $fetch } from '@nuxt/test-utils/e2e' |
| 3 | + |
| 4 | +describe('Playground E2E Tests', async () => { |
| 5 | + await setup({ |
| 6 | + rootDir: '.playground', |
| 7 | + }) |
| 8 | + |
| 9 | + it('should render the index page', async () => { |
| 10 | + const html = await $fetch('/') |
| 11 | + |
| 12 | + // Check that the page renders |
| 13 | + expect(html).toContain('<main>') |
| 14 | + }) |
| 15 | + |
| 16 | + it('should display icons', async () => { |
| 17 | + const html = await $fetch('/') |
| 18 | + |
| 19 | + // Check that AttributeIcon components are rendered with correct classes |
| 20 | + expect(html).toContain('icon--arrow-left') |
| 21 | + expect(html).toContain('icon--arrow-right') |
| 22 | + }) |
| 23 | + |
| 24 | + it('should render menu navigation', async () => { |
| 25 | + const html = await $fetch('/') |
| 26 | + |
| 27 | + // Check that the menu items are rendered |
| 28 | + expect(html).toContain('Home') |
| 29 | + expect(html).toContain('About') |
| 30 | + expect(html).toContain('Contact') |
| 31 | + |
| 32 | + // Check that menu items have proper HTML structure |
| 33 | + expect(html).toContain('<ul>') |
| 34 | + expect(html).toContain('<li>') |
| 35 | + expect(html).toContain('href="/"') |
| 36 | + }) |
| 37 | + |
| 38 | + it('should process markdown content', async () => { |
| 39 | + const html = await $fetch('/') |
| 40 | + |
| 41 | + // Check that the markdown content section is rendered |
| 42 | + expect(html).toContain('class="text"') |
| 43 | + |
| 44 | + // Check that the content from the YAML file is processed |
| 45 | + expect(html).toContain('Lorem') |
| 46 | + expect(html).toContain('Ispum') |
| 47 | + expect(html).toContain('Dolor') |
| 48 | + expect(html).toContain('Amet') |
| 49 | + }) |
| 50 | +}) |
0 commit comments