migrate firebase db

This commit is contained in:
2026-03-09 21:50:49 +01:00
parent a569c070c5
commit b6c2fe1645
18 changed files with 143 additions and 62 deletions

View File

@@ -1,24 +1,20 @@
import {TestBed} from '@angular/core/testing';
import {SongDataService} from './song-data.service';
import {AngularFirestore} from '@angular/fire/compat/firestore';
import {firstValueFrom, of} from 'rxjs';
import {DbService} from '../../../services/db.service';
describe('SongDataService', () => {
const songs = [{title: 'title1'}];
const angularFirestoreCollection = {
valueChanges: () => of(songs),
};
const mockAngularFirestore = {
collection: () => angularFirestoreCollection,
const mockDbService = {
col$: () => of(songs),
};
beforeEach(
() =>
void TestBed.configureTestingModule({
providers: [{provide: AngularFirestore, useValue: mockAngularFirestore}],
providers: [{provide: DbService, useValue: mockDbService}],
})
);

View File

@@ -3,8 +3,7 @@ import {firstValueFrom, Observable} from 'rxjs';
import {Song} from './song';
import {SongDataService} from './song-data.service';
import {UserService} from '../../../services/user/user.service';
import firebase from 'firebase/compat/app';
import Timestamp = firebase.firestore.Timestamp;
import {Timestamp} from '@angular/fire/firestore';
// declare let importCCLI: any;

View File

@@ -1,6 +1,5 @@
import firebase from 'firebase/compat/app';
import {SongLegalOwner, SongLegalType, SongStatus, SongType} from './song.service';
import Timestamp = firebase.firestore.Timestamp;
import {Timestamp} from '@angular/fire/firestore';
export interface Song {
id: string;