test(ct-angular): use analog's vite plugin to handle template files
This commit is contained in:
parent
6ecfba218e
commit
237d065c8e
|
|
@ -26,6 +26,9 @@ export default defineConfig({
|
||||||
use: {
|
use: {
|
||||||
trace: 'on-first-retry',
|
trace: 'on-first-retry',
|
||||||
ctViteConfig: {
|
ctViteConfig: {
|
||||||
|
plugins: [angular({
|
||||||
|
tsconfig: resolve('./tsconfig.spec.json'),
|
||||||
|
})],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': resolve('./src'),
|
'@': resolve('./src'),
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterLink, RouterOutlet } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [RouterModule],
|
imports: [RouterLink, RouterOutlet],
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
template: `
|
template: `
|
||||||
<header>
|
<header>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<h1>Not Inlined</h1>
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
standalone: true,
|
||||||
|
templateUrl: './not-inlined.component.html',
|
||||||
|
})
|
||||||
|
export class NotInlinedComponent {}
|
||||||
|
|
@ -2,6 +2,7 @@ import { test, expect } from '@playwright/experimental-ct-angular';
|
||||||
import { ButtonComponent } from '@/components/button.component';
|
import { ButtonComponent } from '@/components/button.component';
|
||||||
import { EmptyComponent } from '@/components/empty.component';
|
import { EmptyComponent } from '@/components/empty.component';
|
||||||
import { ComponentComponent } from '@/components/component.component';
|
import { ComponentComponent } from '@/components/component.component';
|
||||||
|
import { NotInlinedComponent } from '@/components/not-inlined.component';
|
||||||
|
|
||||||
test('render props', async ({ mount }) => {
|
test('render props', async ({ mount }) => {
|
||||||
const component = await mount(ButtonComponent, {
|
const component = await mount(ButtonComponent, {
|
||||||
|
|
@ -23,3 +24,8 @@ test('render a component without options', async ({ mount }) => {
|
||||||
const component = await mount(ComponentComponent);
|
const component = await mount(ComponentComponent);
|
||||||
await expect(component).toContainText('test');
|
await expect(component).toContainText('test');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('render component with not inlined template', async ({ mount }) => {
|
||||||
|
const component = await mount(NotInlinedComponent);
|
||||||
|
await expect(component).toContainText('Not Inlined');
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue