diff --git a/e2e/modules.spec.ts b/e2e/modules.spec.ts
index 64581fe..16644d6 100644
--- a/e2e/modules.spec.ts
+++ b/e2e/modules.spec.ts
@@ -1,8 +1,20 @@
-import { test } from '@playwright/test';
+import { expect, test } from '@playwright/test';
test('add module', async ({ page }) => {
await page.goto('/');
- await page.locator('app-module-list').getByText('add').click();
+ await page.getByRole('button', { name: 'Add Module' }).click();
await page.getByRole('menuitem', { name: 'HTTP Server' }).click();
- // TODO(jwetzell): test that the module gets added
+ const module = page.locator('#modules\\.0');
+ await expect(module).toBeVisible();
+ await expect(module).toContainText('HTTP Server');
+});
+
+test('remove module', async ({ page }) => {
+ await page.goto('/');
+ await page.getByRole('button', { name: 'Add Module' }).click();
+ await page.getByRole('menuitem', { name: 'HTTP Server' }).click();
+ const module = page.locator('#modules\\.0');
+ await expect(module).toBeVisible();
+ await module.getByRole('button', { name: 'Delete Module' }).click();
+ await expect(module).not.toBeVisible();
});
diff --git a/e2e/routes.spec.ts b/e2e/routes.spec.ts
new file mode 100644
index 0000000..d944e8c
--- /dev/null
+++ b/e2e/routes.spec.ts
@@ -0,0 +1,19 @@
+import { expect, test } from '@playwright/test';
+
+test('add route', async ({ page }) => {
+ await page.goto('/');
+ await page.getByRole('button', { name: 'Add Route' }).click();
+ await page.getByRole('menuitem', { name: 'HTTP Server' }).click();
+ const route = page.locator('#routes\\.0');
+ await expect(route).toBeVisible();
+ await expect(route).toContainText('Route 0');
+});
+
+test('remove route', async ({ page }) => {
+ await page.goto('/');
+ await page.getByRole('button', { name: 'Add Route' }).click();
+ const route = page.locator('#routes\\.0');
+ await expect(route).toBeVisible();
+ await route.getByRole('button', { name: 'Delete Route' }).click();
+ await expect(route).not.toBeVisible();
+});
diff --git a/src/app/components/module-list/module-list.html b/src/app/components/module-list/module-list.html
index 0d740af..4d8516a 100644
--- a/src/app/components/module-list/module-list.html
+++ b/src/app/components/module-list/module-list.html
@@ -5,6 +5,8 @@
matTooltip="Add Module"
class="flex items-center justify-center w-10 h-10 bg-transparent hover:bg-gray-700 hover:cursor-pointer text-blue-400"
[matMenuTriggerFor]="addModuleMenu"
+ role="button"
+ aria-label="Add Module"
>