24 lines
929 B
TypeScript
24 lines
929 B
TypeScript
import { test, expect } from '@playwright/experimental-ct-angular';
|
|
import { ButtonComponent } from '@/components/button.component';
|
|
import { MultiRootComponent } from '@/components/multi-root.component';
|
|
|
|
test('unmount', async ({ page, mount }) => {
|
|
const component = await mount(ButtonComponent, {
|
|
props: {
|
|
title: 'Submit',
|
|
},
|
|
});
|
|
await expect(page.locator('#root')).toContainText('Submit');
|
|
await component.unmount();
|
|
await expect(page.locator('#root')).not.toContainText('Submit');
|
|
});
|
|
|
|
test('unmount a multi root component', async ({ mount, page }) => {
|
|
const component = await mount(MultiRootComponent);
|
|
await expect(page.locator('#root')).toContainText('root 1');
|
|
await expect(page.locator('#root')).toContainText('root 2');
|
|
await component.unmount();
|
|
await expect(page.locator('#root')).not.toContainText('root 1');
|
|
await expect(page.locator('#root')).not.toContainText('root 2');
|
|
});
|