Home / File/ dev-toolbar.test.js — astro Source File

dev-toolbar.test.js — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  2402e9d7_35b2_33a3_8fa2_b582e8452af6["dev-toolbar.test.js"]
  2ca394f6_a63d_3921_1f12_c5a979ea0039["test-utils.js"]
  2402e9d7_35b2_33a3_8fa2_b582e8452af6 --> 2ca394f6_a63d_3921_1f12_c5a979ea0039
  e27f6887_ea47_dd44_7933_5faa0f6bcf4d["testFactory"]
  2402e9d7_35b2_33a3_8fa2_b582e8452af6 --> e27f6887_ea47_dd44_7933_5faa0f6bcf4d
  f8fbe851_c5d6_c4ee_c044_67a751668c18["test"]
  2402e9d7_35b2_33a3_8fa2_b582e8452af6 --> f8fbe851_c5d6_c4ee_c044_67a751668c18
  style 2402e9d7_35b2_33a3_8fa2_b582e8452af6 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/dev-toolbar/',
});

let devServer;

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

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

test.describe('Dev Toolbar', () => {
	test('dev toolbar exists in the page', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/'));

		const devToolbar = page.locator('astro-dev-toolbar');
		await expect(devToolbar).toHaveCount(1);
	});

	test('shows app name on hover', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/'));

		const toolbar = page.locator('astro-dev-toolbar');
		const appButton = toolbar.locator('button[data-app-id="astro:home"]');
		const appButtonTooltip = appButton.locator('.item-tooltip');
		await appButton.hover();

		await expect(appButtonTooltip).toBeVisible();
	});

	test('can open Astro app', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/'));

		const toolbar = page.locator('astro-dev-toolbar');
		const appButton = toolbar.locator('button[data-app-id="astro:home"]');
		await appButton.click();

		const astroAppCanvas = toolbar.locator(
			'astro-dev-toolbar-app-canvas[data-app-id="astro:home"]',
		);
		const astroWindow = astroAppCanvas.locator('astro-dev-toolbar-window');
		await expect(astroWindow).toHaveCount(1);
		await expect(astroWindow).toBeVisible();

		// Toggle app off
		await appButton.click();
		await expect(astroWindow).not.toBeVisible();
	});

	test('show integration app', async ({ page, astro }) => {
		await page.goto(astro.resolveUrl('/view-transition-a'));

		let toolbar = page.locator('astro-dev-toolbar');
		let appButton = toolbar.locator('button[data-app-id="astro:home"]');
// ... (399 more lines)

Domain

Dependencies

Frequently Asked Questions

What does dev-toolbar.test.js do?
dev-toolbar.test.js is a source file in the astro codebase, written in javascript. It belongs to the E2ETesting domain.
What does dev-toolbar.test.js depend on?
dev-toolbar.test.js imports 3 module(s): test, test-utils.js, testFactory.
Where is dev-toolbar.test.js in the architecture?
dev-toolbar.test.js is located at packages/astro/e2e/dev-toolbar.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