You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Replaces `inputs/outputs` with `props/on` to align with Playwright CT for other frameworks.
- Drops spying system (which is not possible anymore as we can't change `mount` returned value with the new version of playwright)
We can also pass custom output callback functions for some extreme cases or if we want to use a custom spy implementation for example or just debug.
50
+
We can also pass custom output callback functions for some extreme cases or if we want to use a custom spy
51
+
implementation for example or just debug.
52
+
70
53
```ts
71
54
awaitmount(NameEditorComponent, {
72
-
outputs: {
55
+
on: {
73
56
nameChange(name) {
74
57
console.log(name);
75
58
}
@@ -89,7 +72,7 @@ import { RecipeSearchTestContainer } from './recipe-search.test-container';
89
72
90
73
test('...', async ({ mount }) => {
91
74
awaitmount(RecipeSearchTestContainer, {
92
-
inputs: {
75
+
props: {
93
76
recipes: [
94
77
beer,
95
78
burger
@@ -140,24 +123,30 @@ We can also customize the shared `playwright/index.html` nearby.
140
123
### Specific Styles
141
124
142
125
If we want to load some specific styles for a single test, we might prefer using a test container component:
126
+
143
127
```ts
144
128
importstylesfrom'./some-styles.css';
129
+
145
130
@Component({
146
131
template: '<jc-greetings></jc-greetings>',
147
132
encapsulation: ViewEncapsulation.None,
148
133
styles: [styles]
149
134
})
150
-
classGreetingsTestContainer {}
135
+
classGreetingsTestContainer {
136
+
}
151
137
```
152
138
153
139
### Angular Material & Angular Libraries with styles
154
140
155
141
As mentioned in [Versatile Angular Style Blog Post](https://marmicode.io/blog/versatile-angular),
156
-
Angular Material and other Angular libraries might use a [Conditional "style" Export](https://nodejs.org/api/packages.html#conditional-exports)
142
+
Angular Material and other Angular libraries might use
143
+
a [Conditional "style" Export](https://nodejs.org/api/packages.html#conditional-exports)
157
144
that allows us to import prebuilt styles
158
-
_(Cf. [Angular Package Format](https://angular.io/guide/angular-package-format)[managing assets in a library](https://angular.io/guide/creating-libraries#managing-assets-in-a-library))_.
145
+
_(
146
+
Cf. [Angular Package Format](https://angular.io/guide/angular-package-format)[managing assets in a library](https://angular.io/guide/creating-libraries#managing-assets-in-a-library))_.
159
147
160
148
In that case, we can add the following configuration to our `playwright-ct.config.ts`:
We'll need a vite plugin to support traditional DI, external templates and stylesheets etc...
238
236
239
237
## 🔮 Future workarounds
240
238
241
239
If you really can't make it to [Versatile Angular Style](https://marmicode.io/blog/versatile-angular),
242
-
we can think of a couple of workarounds like using a vite plugin like **Brandon Roberts' [vite-plugin-angular](https://github.com/analogjs/analog/tree/main/packages/vite-plugin-angular)**
240
+
we can think of a couple of workarounds like using a vite plugin like **Brandon
0 commit comments