Home / File/ server-islands.test.js — astro Source File

server-islands.test.js — astro Source File

Architecture documentation for server-islands.test.js, a javascript file in the astro codebase. 3 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  c7927e92_e9d0_e123_f90d_a510ec783592["server-islands.test.js"]
  2ca394f6_a63d_3921_1f12_c5a979ea0039["test-utils.js"]
  c7927e92_e9d0_e123_f90d_a510ec783592 --> 2ca394f6_a63d_3921_1f12_c5a979ea0039
  e27f6887_ea47_dd44_7933_5faa0f6bcf4d["testFactory"]
  c7927e92_e9d0_e123_f90d_a510ec783592 --> e27f6887_ea47_dd44_7933_5faa0f6bcf4d
  f8fbe851_c5d6_c4ee_c044_67a751668c18["test"]
  c7927e92_e9d0_e123_f90d_a510ec783592 --> f8fbe851_c5d6_c4ee_c044_67a751668c18
  style c7927e92_e9d0_e123_f90d_a510ec783592 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { expect } from '@playwright/test';
import { testFactory } from './test-utils.js';

const test = testFactory(import.meta.url, { root: './fixtures/server-islands/' });

test.describe('Server islands', () => {
	test.describe('Development', () => {
		let devServer;

		test.beforeAll(async ({ astro }) => {
			devServer = await astro.startDevServer();
		});

		test.afterAll(async () => {
			await devServer.stop();
		});

		test('Load content from the server', async ({ page, astro }) => {
			await page.goto(astro.resolveUrl('/base/'));
			let el = page.locator('#basics .island');

			await expect(el, 'element rendered').toBeVisible();
			await expect(el, 'should have content').toHaveText('I am an island');
		});

		test('Can be in an MDX file', async ({ page, astro }) => {
			await page.goto(astro.resolveUrl('/base/mdx/'));
			let el = page.locator('.island');

			await expect(el, 'element rendered').toBeVisible();
			await expect(el, 'should have content').toHaveText('I am an island');
		});

		test('Slots are provided back to the server islands', async ({ page, astro }) => {
			await page.goto(astro.resolveUrl('/base/'));
			let el = page.locator('#children');

			await expect(el, 'element rendered').toBeVisible();
		});

		test('Props are encrypted', async ({ page, astro }) => {
			await page.goto(astro.resolveUrl('/base/'));
			let el = page.locator('#basics .secret');
			await expect(el).toHaveText('test');
		});

		test('content-type header with media type still allows the island to be displayed', async ({
			page,
			astro,
		}) => {
			await page.goto(astro.resolveUrl('/base/'));
			let el = page.locator('#charset-in-content-type');
			await expect(el).toHaveCount(1);
		});

		test('Self imported module can server defer', async ({ page, astro }) => {
			await page.goto(astro.resolveUrl('/base/'));
			let el = page.locator('.now');

			await expect(el).toHaveCount(2);
// ... (82 more lines)

Domain

Dependencies

Frequently Asked Questions

What does server-islands.test.js do?
server-islands.test.js is a source file in the astro codebase, written in javascript. It belongs to the E2ETesting domain.
What does server-islands.test.js depend on?
server-islands.test.js imports 3 module(s): test, test-utils.js, testFactory.
Where is server-islands.test.js in the architecture?
server-islands.test.js is located at packages/astro/e2e/server-islands.test.js (domain: E2ETesting, directory: packages/astro/e2e).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free