Skip to content

Commit a97d115

Browse files
committed
fix company test
1 parent 9bfb5e2 commit a97d115

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/components/company.test.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,18 @@ test("company component builds profile URL correctly", () => {
6868
expect(url).toBe("https://joblist.today/test-company");
6969
});
7070

71-
test("company component renders no company message when no data", () => {
71+
test("company component renders no company message when no data", async () => {
7272
const company = document.createElement("joblist-company");
7373
company.setAttribute("company-id", "nonexistent");
7474
document.body.appendChild(company);
7575

76-
// Should show no company message
76+
// Should initially show loading message
77+
expect(company.textContent).toContain("Loading company nonexistent...");
78+
79+
// Wait for async loading to complete
80+
await new Promise(resolve => setTimeout(resolve, 100));
81+
82+
// Should show no company message after loading fails
7783
expect(company.textContent).toContain("No company nonexistent");
7884
});
7985

0 commit comments

Comments
 (0)