add unit tests

This commit is contained in:
2026-03-10 00:05:08 +01:00
parent db6a230696
commit 7170e4a08e
17 changed files with 862 additions and 50 deletions

View File

@@ -18,12 +18,7 @@ export class UploadService extends FileBase {
const filePath = `${directory}/${upload.file.name}`;
upload.path = directory;
const {task} = runInInjectionContext(this.environmentInjector, () => {
const storageRef = ref(this.storage, filePath);
return {
task: uploadBytesResumable(storageRef, upload.file),
};
});
const task = runInInjectionContext(this.environmentInjector, () => this.startUpload(filePath, upload.file));
task.on(
'state_changed',
@@ -45,4 +40,9 @@ export class UploadService extends FileBase {
};
await this.fileDataService.set(songId, file);
}
private startUpload(filePath: string, file: File) {
const storageRef = ref(this.storage, filePath);
return uploadBytesResumable(storageRef, file);
}
}