tangled
alpha
login
or
join now
cosmik.network
/
semble
43
fork
atom
A social knowledge tool for researchers built on ATProto
43
fork
atom
overview
issues
13
pulls
pipelines
formatting and linting
Wesley Finck
4 months ago
93367382
178239ce
+16
-7
2 changed files
expand all
collapse all
unified
split
src
modules
cards
application
useCases
queries
GetUrlStatusForMyLibraryUseCase.ts
tests
infrastructure
DrizzleCardQueryRepository.getUrlCardBasic.integration.test.ts
+7
-4
src/modules/cards/application/useCases/queries/GetUrlStatusForMyLibraryUseCase.ts
···
101
101
);
102
102
103
103
if (authorProfileResult.isErr()) {
104
104
-
return err(AppError.UnexpectedError.create(authorProfileResult.error));
104
104
+
return err(
105
105
+
AppError.UnexpectedError.create(authorProfileResult.error),
106
106
+
);
105
107
}
106
108
107
109
const authorProfile = authorProfileResult.value;
···
154
156
const fullCollection = collectionResult.value;
155
157
156
158
// Fetch author profile
157
157
-
const authorProfileResult = await this.profileService.getProfile(
158
158
-
fullCollection.authorId.value,
159
159
-
);
159
159
+
const authorProfileResult =
160
160
+
await this.profileService.getProfile(
161
161
+
fullCollection.authorId.value,
162
162
+
);
160
163
if (authorProfileResult.isErr()) {
161
164
throw new Error(
162
165
`Failed to fetch author profile: ${authorProfileResult.error.message}`,
+9
-3
src/modules/cards/tests/infrastructure/DrizzleCardQueryRepository.getUrlCardBasic.integration.test.ts
···
115
115
expect(result?.type).toBe(CardTypeEnum.URL);
116
116
expect(result?.url).toBe(url.value);
117
117
expect(result?.cardContent.title).toBe('Test Article');
118
118
-
expect(result?.cardContent.description).toBe('A test article description');
118
118
+
expect(result?.cardContent.description).toBe(
119
119
+
'A test article description',
120
120
+
);
119
121
expect(result?.cardContent.author).toBe('John Doe');
120
120
-
expect(result?.cardContent.thumbnailUrl).toBe('https://example.com/image.jpg');
122
122
+
expect(result?.cardContent.thumbnailUrl).toBe(
123
123
+
'https://example.com/image.jpg',
124
124
+
);
121
125
expect(result?.note).toBeUndefined();
122
126
});
123
127
···
152
156
153
157
it('should NOT include note card by a different author', async () => {
154
158
// Create URL card by first author
155
155
-
const url = URL.create('https://example.com/article-different-author').unwrap();
159
159
+
const url = URL.create(
160
160
+
'https://example.com/article-different-author',
161
161
+
).unwrap();
156
162
const urlCard = new CardBuilder()
157
163
.withCuratorId(curatorId.value)
158
164
.withUrlCard(url)