Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/angular/core-17.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
joaqcid committed Jul 2, 2024
2 parents bc219fb + ed0aa21 commit 3f33609
Show file tree
Hide file tree
Showing 33 changed files with 3,548 additions and 2,609 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file. See
[standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [18.0.2](https://github.com/ngxs-labs/firestore-plugin/compare/v18.0.1...v18.0.2) (2024-07-02)

### [18.0.1](https://github.com/ngxs-labs/firestore-plugin/compare/v18.0.0...v18.0.1) (2024-07-02)

## [18.0.0](https://github.com/ngxs-labs/firestore-plugin/compare/v1.2.11...v18.0.0) (2024-07-02)

### [1.2.11](https://github.com/ngxs-labs/firestore-plugin/compare/v1.2.10...v1.2.11) (2024-07-02)

### Features

- collectionGroup support
([ba369f2](https://github.com/ngxs-labs/firestore-plugin/commit/ba369f219190e692c65dd2ff5bd13e36b9e90621))

### Bug Fixes

- disconnect matching actions without specifying payload
([b6e3bb4](https://github.com/ngxs-labs/firestore-plugin/commit/b6e3bb41f6a1343d89703c84f0aeb9af8967aa30))

### 1.2.10 (2024-04-15)

### Features
Expand Down
28 changes: 14 additions & 14 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"allowedCommonJsDependencies": ["chance"],
"outputPath": "dist/integrations/compat",
"outputPath": {
"base": "dist/integrations/compat"
},
"index": "integrations/compat/src/index.html",
"main": "integrations/compat/src/main.ts",
"polyfills": "integrations/compat/src/polyfills.ts",
"polyfills": ["integrations/compat/src/polyfills.ts"],
"tsConfig": "integrations/compat/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": ["integrations/compat/src/favicon.ico", "integrations/compat/src/assets"],
"styles": ["integrations/compat/src/styles.scss"],
"scripts": []
"scripts": [],
"browser": "integrations/compat/src/main.ts"
},
"configurations": {
"production": {
Expand All @@ -74,9 +76,7 @@
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
Expand Down Expand Up @@ -113,13 +113,14 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/modular",
"outputPath": {
"base": "dist/modular"
},
"allowedCommonJsDependencies": ["chance"],
"index": "integrations/modular/src/index.html",
"main": "integrations/modular/src/main.ts",
"polyfills": "integrations/modular/src/polyfills.ts",
"polyfills": ["integrations/modular/src/polyfills.ts"],
"tsConfig": "integrations/modular/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
Expand All @@ -129,7 +130,8 @@
"integrations/modular/src/manifest.webmanifest"
],
"styles": ["integrations/modular/src/styles.scss"],
"scripts": []
"scripts": [],
"browser": "integrations/modular/src/main.ts"
},
"configurations": {
"production": {
Expand All @@ -154,9 +156,7 @@
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';

import { ListOnceComponent } from './list-once.component';
import { Store, NgxsModule } from '@ngxs/store';
Expand All @@ -10,18 +10,20 @@ describe('ListOnceComponent', () => {
let fixture: ComponentFixture<ListOnceComponent>;
let storeMock;

beforeEach(async(() => {
storeMock = jest.fn().mockImplementation(() => ({
select: jest.fn().mockReturnValue(new Subject()),
dispatch: jest.fn().mockReturnValue(new Subject())
}));
beforeEach(
waitForAsync(() => {
storeMock = jest.fn().mockImplementation(() => ({
select: jest.fn().mockReturnValue(new Subject()),
dispatch: jest.fn().mockReturnValue(new Subject())
}));

TestBed.configureTestingModule({
imports: [NgxsModule.forRoot(), NgxsFirestoreModule.forRoot()],
declarations: [ListOnceComponent],
providers: [{ provide: Store, useValue: storeMock() }]
}).compileComponents();
}));
TestBed.configureTestingModule({
imports: [NgxsModule.forRoot(), NgxsFirestoreModule.forRoot()],
declarations: [ListOnceComponent],
providers: [{ provide: Store, useValue: storeMock() }]
}).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(ListOnceComponent);
Expand Down
26 changes: 14 additions & 12 deletions integrations/compat/src/app/components/list/list.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';

import { ListComponent } from './list.component';
import { Store, NgxsModule } from '@ngxs/store';
Expand All @@ -10,18 +10,20 @@ describe('ListComponent', () => {
let fixture: ComponentFixture<ListComponent>;
let storeMock;

beforeEach(async(() => {
storeMock = jest.fn().mockImplementation(() => ({
select: jest.fn().mockReturnValue(new Subject()),
dispatch: jest.fn().mockReturnValue(new Subject())
}));
beforeEach(
waitForAsync(() => {
storeMock = jest.fn().mockImplementation(() => ({
select: jest.fn().mockReturnValue(new Subject()),
dispatch: jest.fn().mockReturnValue(new Subject())
}));

TestBed.configureTestingModule({
imports: [NgxsModule.forRoot(), NgxsFirestoreModule.forRoot()],
declarations: [ListComponent],
providers: [{ provide: Store, useValue: storeMock() }]
}).compileComponents();
}));
TestBed.configureTestingModule({
imports: [NgxsModule.forRoot(), NgxsFirestoreModule.forRoot()],
declarations: [ListComponent],
providers: [{ provide: Store, useValue: storeMock() }]
}).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(ListComponent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { OtherComponent } from './other.component';

describe('OtherComponent', () => {
let component: OtherComponent;
let fixture: ComponentFixture<OtherComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [OtherComponent]
}).compileComponents();
}));
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [OtherComponent]
}).compileComponents();
})
);

beforeEach(() => {});

Expand Down
2 changes: 1 addition & 1 deletion integrations/compat/src/app/models/race.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface Race {
// id: string;
id: string;
raceId: string;
title: string;
description: string;
Expand Down
15 changes: 9 additions & 6 deletions integrations/compat/src/app/services/races.firestore.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { TestBed, async } from '@angular/core/testing';
import { TestBed, waitForAsync } from '@angular/core/testing';
import { RacesFirestore } from './races.firestore';
import { NgxsModule } from '@ngxs/store';
import { NgxsFirestoreModule } from '@ngxs-labs/firestore-plugin';
import { AngularFirestore } from '@angular/fire/compat/firestore';

describe('RacesFirestore', () => {
beforeEach(async(() =>
TestBed.configureTestingModule({
imports: [NgxsModule.forRoot([]), NgxsFirestoreModule.forRoot()],
providers: [{ provide: AngularFirestore, useValue: jest.fn() }]
})));
beforeEach(
waitForAsync(() =>
TestBed.configureTestingModule({
imports: [NgxsModule.forRoot([]), NgxsFirestoreModule.forRoot()],
providers: [{ provide: AngularFirestore, useValue: jest.fn() }]
})
)
);

it('should be created', () => {
const service: RacesFirestore = TestBed.inject(RacesFirestore);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TestBed, async } from '@angular/core/testing';
import { TestBed, waitForAsync } from '@angular/core/testing';
import { NgxsModule, Store } from '@ngxs/store';
import { ClassificationsState } from './classifications.state';
import { NgxsFirestoreModule } from '@ngxs-labs/firestore-plugin';
Expand All @@ -12,20 +12,22 @@ describe('Classifications State', () => {
let mockClassificationsFS;
let mockCollection$: jest.Mock;

beforeEach(async(() => {
mockClassificationsFS = jest.fn(() => ({
collection$: mockCollection$,
setRaceId: jest.fn()
}));
beforeEach(
waitForAsync(() => {
mockClassificationsFS = jest.fn(() => ({
collection$: mockCollection$,
setRaceId: jest.fn()
}));

mockCollection$ = jest.fn();
mockCollection$ = jest.fn();

TestBed.configureTestingModule({
imports: [NgxsModule.forRoot([ClassificationsState]), NgxsFirestoreModule.forRoot()],
providers: [{ provide: ClassificationsFirestore, useValue: mockClassificationsFS() }]
}).compileComponents();
store = TestBed.inject(Store);
}));
TestBed.configureTestingModule({
imports: [NgxsModule.forRoot([ClassificationsState]), NgxsFirestoreModule.forRoot()],
providers: [{ provide: ClassificationsFirestore, useValue: mockClassificationsFS() }]
}).compileComponents();
store = TestBed.inject(Store);
})
);

it('should getall classifications', () => {
mockCollection$.mockReturnValue(new BehaviorSubject([{ id: 'a' }]));
Expand Down
32 changes: 17 additions & 15 deletions integrations/compat/src/app/states/races/races.state.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TestBed, async } from '@angular/core/testing';
import { TestBed, waitForAsync } from '@angular/core/testing';
import { NgxsModule, Store } from '@ngxs/store';
import { RacesState } from './races.state';
import { RacesActions } from './races.actions';
Expand All @@ -13,22 +13,24 @@ describe('Races State', () => {
let mockRacesFS;
let mockCollection$: jest.Mock;

beforeEach(async(() => {
mockRacesFS = jest.fn(() => ({
collection$: mockCollection$
}));
beforeEach(
waitForAsync(() => {
mockRacesFS = jest.fn(() => ({
collection$: mockCollection$
}));

mockCollection$ = jest.fn();
mockCollection$ = jest.fn();

TestBed.configureTestingModule({
imports: [NgxsModule.forRoot([RacesState]), NgxsFirestoreModule.forRoot()],
providers: [
{ provide: RacesFirestore, useValue: mockRacesFS() },
{ provide: NgxsFirestorePageIdService, useValue: { createId: jest.fn() } }
]
}).compileComponents();
store = TestBed.inject(Store);
}));
TestBed.configureTestingModule({
imports: [NgxsModule.forRoot([RacesState]), NgxsFirestoreModule.forRoot()],
providers: [
{ provide: RacesFirestore, useValue: mockRacesFS() },
{ provide: NgxsFirestorePageIdService, useValue: { createId: jest.fn() } }
]
}).compileComponents();
store = TestBed.inject(Store);
})
);

it('should getall races', () => {
mockCollection$.mockReturnValue(new BehaviorSubject([{ raceId: 'a' }]));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';

import { ListOnceComponent } from './list-once.component';
import { Store, NgxsModule } from '@ngxs/store';
Expand All @@ -10,18 +10,20 @@ describe('ListOnceComponent', () => {
let fixture: ComponentFixture<ListOnceComponent>;
let storeMock;

beforeEach(async(() => {
storeMock = jest.fn().mockImplementation(() => ({
select: jest.fn().mockReturnValue(new Subject()),
dispatch: jest.fn().mockReturnValue(new Subject())
}));
beforeEach(
waitForAsync(() => {
storeMock = jest.fn().mockImplementation(() => ({
select: jest.fn().mockReturnValue(new Subject()),
dispatch: jest.fn().mockReturnValue(new Subject())
}));

TestBed.configureTestingModule({
imports: [NgxsModule.forRoot(), NgxsFirestoreModule.forRoot()],
declarations: [ListOnceComponent],
providers: [{ provide: Store, useValue: storeMock() }]
}).compileComponents();
}));
TestBed.configureTestingModule({
imports: [NgxsModule.forRoot(), NgxsFirestoreModule.forRoot()],
declarations: [ListOnceComponent],
providers: [{ provide: Store, useValue: storeMock() }]
}).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(ListOnceComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<button [disabled]="gettingSubCollection$ | async" class="btn btn-primary mr-1" (click)="getSubCollection()">
Get SubCollection
</button>
<button [disabled]="gettingSubCollection$ | async" class="btn btn-primary mr-1" (click)="getCollectionGroup()">
Get Collection Group
</button>
</div>
<div class="my-3">
<button class="btn btn-primary mr-1" [disabled]="disconnecting$ | async" (click)="disconnect()">Disconnect</button>
Expand Down
Loading

0 comments on commit 3f33609

Please sign in to comment.