forked from sand4rt/playwright-ct-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
render.spec.ts
25 lines (22 loc) · 847 Bytes
/
render.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { test, expect } from '@sand4rt/experimental-ct-web';
import { Button } from '@/components/Button';
import { Component } from '@/components/Component';
import { EmptyTemplate } from '@/components/EmptyTemplate';
test('render props', async ({ mount }) => {
const component = await mount(Button, {
props: {
title: 'Submit',
},
});
await expect(component).toContainText('Submit');
});
test('render a component without options', async ({ mount }) => {
const component = await mount(Component);
await expect(component).toContainText('test');
});
test('get textContent of the empty template', async ({ mount }) => {
const component = await mount(EmptyTemplate);
expect(await component.allTextContents()).toEqual(['']);
expect(await component.textContent()).toBe('');
await expect(component).toHaveText('');
});