summaryrefslogtreecommitdiff
path: root/packages/astro/e2e/astro-component.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro/e2e/astro-component.test.js')
-rw-r--r--packages/astro/e2e/astro-component.test.js31
1 files changed, 29 insertions, 2 deletions
diff --git a/packages/astro/e2e/astro-component.test.js b/packages/astro/e2e/astro-component.test.js
index 8ebbcd3a6..ac5531fbe 100644
--- a/packages/astro/e2e/astro-component.test.js
+++ b/packages/astro/e2e/astro-component.test.js
@@ -1,6 +1,5 @@
import { expect } from '@playwright/test';
-import os from 'os';
-import { testFactory } from './test-utils.js';
+import { getColor, testFactory } from './test-utils.js';
const test = testFactory({ root: './fixtures/astro-component/' });
@@ -79,4 +78,32 @@ test.describe('Astro component HMR', () => {
await updatedLog;
});
+
+ test('update linked dep Astro html', async ({ page, astro }) => {
+ await page.goto(astro.resolveUrl('/'));
+ let h1 = page.locator('#astro-linked-lib');
+ expect(await h1.textContent()).toBe('astro-linked-lib');
+ await Promise.all([
+ page.waitForLoadState('networkidle'),
+ await astro.editFile('../_deps/astro-linked-lib/Component.astro', (content) =>
+ content.replace('>astro-linked-lib<', '>astro-linked-lib-update<')
+ ),
+ ]);
+ h1 = page.locator('#astro-linked-lib');
+ expect(await h1.textContent()).toBe('astro-linked-lib-update');
+ });
+
+ test('update linked dep Astro style', async ({ page, astro }) => {
+ await page.goto(astro.resolveUrl('/'));
+ let h1 = page.locator('#astro-linked-lib');
+ expect(await getColor(h1)).toBe('rgb(255, 0, 0)');
+ await Promise.all([
+ page.waitForLoadState('networkidle'),
+ await astro.editFile('../_deps/astro-linked-lib/Component.astro', (content) =>
+ content.replace('color: red', 'color: green')
+ ),
+ ]);
+ h1 = page.locator('#astro-linked-lib');
+ expect(await getColor(h1)).toBe('rgb(0, 128, 0)');
+ });
});