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: {
|
||||
trace: 'on-first-retry',
|
||||
ctViteConfig: {
|
||||
plugins: [angular({
|
||||
tsconfig: resolve('./tsconfig.spec.json'),
|
||||
})],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve('./src'),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { RouterLink, RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [RouterModule],
|
||||
imports: [RouterLink, RouterOutlet],
|
||||
selector: 'app-root',
|
||||
template: `
|
||||
<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 { EmptyComponent } from '@/components/empty.component';
|
||||
import { ComponentComponent } from '@/components/component.component';
|
||||
import { NotInlinedComponent } from '@/components/not-inlined.component';
|
||||
|
||||
test('render props', async ({ mount }) => {
|
||||
const component = await mount(ButtonComponent, {
|
||||
|
|
@ -23,3 +24,8 @@ test('render a component without options', async ({ mount }) => {
|
|||
const component = await mount(ComponentComponent);
|
||||
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