Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/core/src/__tests__/e2e/events.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ describe("Events E2E", () => {
const first = result.results[0]!;
expect(first.event_id.length).toBeGreaterThan(0);
expect(first.title.length).toBeGreaterThan(0);
expect(first.title.length).toBeLessThan(200);
expect(typeof first.date_time).toBe("string");
expect(first.date_time.length).toBeLessThan(100);
expect(typeof first.location).toBe("string");
expect(typeof first.organizer).toBe("string");
expect(typeof first.attendee_count).toBe("string");
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/__tests__/e2e/search.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ describe("Search E2E", () => {
expect(first).toBeDefined();
if (first) {
expect(first.title.length).toBeGreaterThan(0);
expect(first.title.length).toBeLessThan(200);
expect(first.date.length).toBeLessThan(100);
}
});

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/linkedinEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ async function extractEventSearchResults(
return uniqueLinks.slice(0, maxEvents).map((link) => {
const card = link.closest("li") ?? link.closest("div[data-view-tracking-scope]") ?? link.closest("div.search-result__wrapper") ?? link.parentElement;

const rawText = normalize((card as HTMLElement)?.innerText ?? link.innerText ?? "");
const rawText = (card as HTMLElement)?.innerText ?? link.innerText ?? "";
const lines = rawText
.split("\n")
.map((line) => normalize(line))
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/linkedinSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2295,7 +2295,7 @@ export class LinkedInSearchService {

return Array.from(globalThis.document.querySelectorAll("main li, div.search-results-container ul > li, ul.reusable-search__entity-result-list > li"))
.map((card) => {
const lines = normalize((card as HTMLElement).innerText)
const lines = ((card as HTMLElement).innerText || "")
.split("\n")
.map((line) => normalize(line))
.filter(Boolean);
Expand Down