Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects/example-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Built with [@angular/cli](https://github.com/angular/angular-cli)
- [@ngrx/store-devtools](https://ngrx.io/guide/store-devtools) - Instrumentation for @ngrx/store enabling time-travel debugging
- [@angular/router](https://angular.dev/guide/routing) - Angular Router
- [@angular/material](https://material.angular.io) - Angular Material
- [jest](https://jestjs.io) - JavaScript test runner with easy setup, isolated browser testing and snapshot testing
- [vitest](https://vitest.dev) - JavaScript test runner with easy setup, isolated browser testing and snapshot testing

### Quick start

Expand Down
23 changes: 0 additions & 23 deletions projects/example-app/jest.config.ts

This file was deleted.

8 changes: 1 addition & 7 deletions projects/example-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,7 @@
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "projects/example-app/jest.config.ts",
"runInBand": true,
"passWithNoTests": false
},
"outputs": ["{workspaceRoot}/coverage/projects/example-app"]
"executor": "@analogjs/vitest-angular:test"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Login Page should compile 1`] = `
exports[`Login Page > should compile 1`] = `
<bc-login-form
form={[Function FormGroup]}
submitted={[Function EventEmitter_]}
errormessage="[object Object]"
pending="[object Object]"
submitted="[object Object]"
>
<mat-card>
<mat-card-title>
<mat-card
_ngcontent-a-c1882380116=""
>
<mat-card-title
_ngcontent-a-c1882380116=""
>
Login
</mat-card-title>
<mat-card-content>
<mat-card-content
_ngcontent-a-c1882380116=""
>
<form
_ngcontent-a-c1882380116=""
class="ng-untouched ng-pristine ng-valid"
novalidate=""
>
<p>
<mat-form-field>
<p
_ngcontent-a-c1882380116=""
>
<mat-form-field
_ngcontent-a-c1882380116=""
>
<input
_ngcontent-a-c1882380116=""
class="ng-untouched ng-pristine ng-valid"
formcontrolname="username"
matinput=""
Expand All @@ -25,9 +38,14 @@ exports[`Login Page should compile 1`] = `
/>
</mat-form-field>
</p>
<p>
<mat-form-field>
<p
_ngcontent-a-c1882380116=""
>
<mat-form-field
_ngcontent-a-c1882380116=""
>
<input
_ngcontent-a-c1882380116=""
class="ng-untouched ng-pristine ng-valid"
formcontrolname="password"
matinput=""
Expand All @@ -36,10 +54,13 @@ exports[`Login Page should compile 1`] = `
/>
</mat-form-field>
</p>
<!--container-->
<div
_ngcontent-a-c1882380116=""
class="login-buttons"
>
<button
_ngcontent-a-c1882380116=""
mat-button=""
type="submit"
>
Expand All @@ -52,23 +73,36 @@ exports[`Login Page should compile 1`] = `
</bc-login-form>
`;

exports[`Login Page should disable the form if pending 1`] = `
exports[`Login Page > should disable the form if pending 1`] = `
<bc-login-form
form={[Function FormGroup]}
submitted={[Function EventEmitter_]}
errormessage="[object Object]"
pending="[object Object]"
submitted="[object Object]"
>
<mat-card>
<mat-card-title>
<mat-card
_ngcontent-a-c1882380116=""
>
<mat-card-title
_ngcontent-a-c1882380116=""
>
Login
</mat-card-title>
<mat-card-content>
<mat-card-content
_ngcontent-a-c1882380116=""
>
<form
_ngcontent-a-c1882380116=""
class="ng-untouched ng-pristine"
novalidate=""
>
<p>
<mat-form-field>
<p
_ngcontent-a-c1882380116=""
>
<mat-form-field
_ngcontent-a-c1882380116=""
>
<input
_ngcontent-a-c1882380116=""
class="ng-untouched ng-pristine"
disabled=""
formcontrolname="username"
Expand All @@ -78,9 +112,14 @@ exports[`Login Page should disable the form if pending 1`] = `
/>
</mat-form-field>
</p>
<p>
<mat-form-field>
<p
_ngcontent-a-c1882380116=""
>
<mat-form-field
_ngcontent-a-c1882380116=""
>
<input
_ngcontent-a-c1882380116=""
class="ng-untouched ng-pristine"
disabled=""
formcontrolname="password"
Expand All @@ -90,10 +129,13 @@ exports[`Login Page should disable the form if pending 1`] = `
/>
</mat-form-field>
</p>
<!--container-->
<div
_ngcontent-a-c1882380116=""
class="login-buttons"
>
<button
_ngcontent-a-c1882380116=""
mat-button=""
type="submit"
>
Expand All @@ -106,24 +148,36 @@ exports[`Login Page should disable the form if pending 1`] = `
</bc-login-form>
`;

exports[`Login Page should display an error message if provided 1`] = `
exports[`Login Page > should display an error message if provided 1`] = `
<bc-login-form
errorMessage={[Function String]}
form={[Function FormGroup]}
submitted={[Function EventEmitter_]}
errormessage="[object Object]"
pending="[object Object]"
submitted="[object Object]"
>
<mat-card>
<mat-card-title>
<mat-card
_ngcontent-a-c1882380116=""
>
<mat-card-title
_ngcontent-a-c1882380116=""
>
Login
</mat-card-title>
<mat-card-content>
<mat-card-content
_ngcontent-a-c1882380116=""
>
<form
_ngcontent-a-c1882380116=""
class="ng-untouched ng-pristine ng-valid"
novalidate=""
>
<p>
<mat-form-field>
<p
_ngcontent-a-c1882380116=""
>
<mat-form-field
_ngcontent-a-c1882380116=""
>
<input
_ngcontent-a-c1882380116=""
class="ng-untouched ng-pristine ng-valid"
formcontrolname="username"
matinput=""
Expand All @@ -132,9 +186,14 @@ exports[`Login Page should display an error message if provided 1`] = `
/>
</mat-form-field>
</p>
<p>
<mat-form-field>
<p
_ngcontent-a-c1882380116=""
>
<mat-form-field
_ngcontent-a-c1882380116=""
>
<input
_ngcontent-a-c1882380116=""
class="ng-untouched ng-pristine ng-valid"
formcontrolname="password"
matinput=""
Expand All @@ -144,14 +203,18 @@ exports[`Login Page should display an error message if provided 1`] = `
</mat-form-field>
</p>
<p
_ngcontent-a-c1882380116=""
class="login-error"
>
Invalid credentials
</p>
<!--container-->
<div
_ngcontent-a-c1882380116=""
class="login-buttons"
>
<button
_ngcontent-a-c1882380116=""
mat-button=""
type="submit"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Logout Confirmation Dialog should compile 1`] = `
<ng-component>
exports[`Logout Confirmation Dialog > should compile 1`] = `
<undefined>
<h2
_ngcontent-a-c626405556=""
class="mat-mdc-dialog-title mdc-dialog__title"
id="mat-mdc-dialog-title-a0"
mat-dialog-title=""
>
Logout
</h2><mat-dialog-content
</h2>
<mat-dialog-content
_ngcontent-a-c626405556=""
class="mat-mdc-dialog-content mdc-dialog__content"
>
Are you sure you want to logout?
</mat-dialog-content><mat-dialog-actions
</mat-dialog-content>
<mat-dialog-actions
_ngcontent-a-c626405556=""
class="mat-mdc-dialog-actions mdc-dialog__actions"
>
<button
_ngcontent-a-c626405556=""
class="mdc-button mat-mdc-button-base mat-mdc-button mat-unthemed"
mat-button=""
mat-ripple-loader-class-name="mat-mdc-button-ripple"
Expand All @@ -38,6 +44,7 @@ exports[`Logout Confirmation Dialog should compile 1`] = `
/>
</button>
<button
_ngcontent-a-c626405556=""
class="mdc-button mat-mdc-button-base mat-mdc-button mat-unthemed"
mat-button=""
mat-ripple-loader-class-name="mat-mdc-button-ripple"
Expand All @@ -60,5 +67,5 @@ exports[`Logout Confirmation Dialog should compile 1`] = `
/>
</button>
</mat-dialog-actions>
</ng-component>
</undefined>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('Login Page', () => {
};
instance.form.setValue(credentials);

jest.spyOn(instance.submitted, 'emit');
vi.spyOn(instance.submitted, 'emit');
instance.submit();

expect(instance.submitted.emit).toHaveBeenCalledWith(credentials);
Expand Down
Loading