refactor: user factories instead of stubs (#17540)

This commit is contained in:
Jason Rasmussen
2025-04-11 11:53:37 -04:00
committed by GitHub
parent 52d4b2fe57
commit 584e5894bf
17 changed files with 297 additions and 251 deletions

View File

@@ -88,7 +88,7 @@ describe(AssetService.name, () => {
it('should get memories with partners with inTimeline enabled', async () => {
const partner = factory.partner();
const auth = factory.auth({ id: partner.sharedWithId });
const auth = factory.auth({ user: { id: partner.sharedWithId } });
mocks.partner.getAll.mockResolvedValue([partner]);
mocks.asset.getByDayOfYear.mockResolvedValue([]);
@@ -139,7 +139,7 @@ describe(AssetService.name, () => {
it('should not include partner assets if not in timeline', async () => {
const partner = factory.partner({ inTimeline: false });
const auth = factory.auth({ id: partner.sharedWithId });
const auth = factory.auth({ user: { id: partner.sharedWithId } });
mocks.asset.getRandom.mockResolvedValue([assetStub.image]);
mocks.partner.getAll.mockResolvedValue([partner]);
@@ -151,7 +151,7 @@ describe(AssetService.name, () => {
it('should include partner assets if in timeline', async () => {
const partner = factory.partner({ inTimeline: true });
const auth = factory.auth({ id: partner.sharedWithId });
const auth = factory.auth({ user: { id: partner.sharedWithId } });
mocks.asset.getRandom.mockResolvedValue([assetStub.image]);
mocks.partner.getAll.mockResolvedValue([partner]);