Skip to content

Commit

Permalink
Merge pull request #8 from FullStacksDev/tweaks-from-simple-example-app
Browse files Browse the repository at this point in the history
Small tweaks from the simple example app
  • Loading branch information
jits authored Mar 1, 2024
2 parents 7d53a71 + 578a5a5 commit 87d30d5
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 106 deletions.
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@ngrx/operators": "^17.1.1",
"@ngrx/signals": "^17.1.1",
"consola": "^3.2.3",
"express": "^4.18.2",
"express": "^4.18.3",
"firebase": "^10.8.1",
"ngxtension": "^2.1.0",
"rxfire": "^6.0.5",
Expand All @@ -53,7 +53,7 @@
"@angular/compiler-cli": "^17.2.3",
"@types/express": "^4.17.17",
"@types/jasmine": "~5.1.0",
"@types/node": "^20.11.22",
"@types/node": "^20.11.24",
"@typescript-eslint/eslint-plugin": "7.1.0",
"@typescript-eslint/parser": "7.1.0",
"autoprefixer": "^10.4.17",
Expand Down
94 changes: 32 additions & 62 deletions app/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions app/src/app/login/data/login.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { FIREBASE_AUTH } from '@app-shared/firebase/auth';
import { MockBuilder, MockRender } from 'ng-mocks';
import { MockBuilder, ngMocks } from 'ng-mocks';
import { LoginService } from './login.service';

describe('LoginService', () => {
beforeEach(() => MockBuilder(LoginService, null).mock(FIREBASE_AUTH));

it('should be created', () => {
const fixture = MockRender(LoginService);

const service = fixture.point.componentInstance;
it('should create', () => {
const service = ngMocks.get(LoginService);
expect(service).toBeTruthy();
});
});
10 changes: 4 additions & 6 deletions app/src/app/login/feature/login-flow.store.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ActivatedRoute, Router } from '@angular/router';
import { MockBuilder, MockRender } from 'ng-mocks';
import { MockBuilder, ngMocks } from 'ng-mocks';
import { LoginService } from '../data/login.service';
import { LoginFlowStore } from './login-flow.store';

Expand All @@ -8,10 +8,8 @@ describe('LoginFlowStore', () => {
MockBuilder(LoginFlowStore).mock(LoginService).mock(ActivatedRoute).mock(Router),
);

it('should be created', () => {
const fixture = MockRender(LoginFlowStore);

const service = fixture.point.componentInstance;
expect(service).toBeTruthy();
it('should create', () => {
const store = ngMocks.get(LoginFlowStore);
expect(store).toBeTruthy();
});
});
5 changes: 3 additions & 2 deletions app/src/app/login/ui/login-form.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Component, Input } from '@angular/core';
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';
import { LoginFormComponent } from './login-form.component';

@Component({
standalone: true,
template: `<app-login-form [processing]="processing" />`,
imports: [LoginFormComponent],
template: `<app-login-form [processing]="processing" />`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
class TestComponent {
@Input() processing = false;
Expand Down
8 changes: 3 additions & 5 deletions app/src/app/shared/auth/data/auth.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { FIREBASE_AUTH } from '@app-shared/firebase/auth';
import { RuntimeService } from '@app-shared/runtime.service';
import { MockBuilder, MockRender } from 'ng-mocks';
import { MockBuilder, ngMocks } from 'ng-mocks';
import { AuthService } from './auth.service';

describe('AuthService', () => {
beforeEach(() => MockBuilder(AuthService).mock(RuntimeService).mock(FIREBASE_AUTH));

it('should be created', () => {
const fixture = MockRender(AuthService);

const service = fixture.point.componentInstance;
it('should create', () => {
const service = ngMocks.get(AuthService);
expect(service).toBeTruthy();
});
});
Loading

0 comments on commit 87d30d5

Please sign in to comment.