Skip to content

Commit

Permalink
Исправление тестов
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyAkkuratov committed May 30, 2024
1 parent 7977635 commit c114754
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/weatherApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default async function weatherApp(rootElement) {
if (event.target instanceof HTMLAnchorElement) {
event.preventDefault();
// eslint-disable-next-line no-undef
router.navigate(PREFIX + event.target.href);
router.navigate(event.target.href);
}
});

Expand Down
8 changes: 7 additions & 1 deletion src/weatherApp.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ describe("Weather application tests", () => {
expect(el.innerHTML).toBe(aboutTemplate);

el.querySelector("a").click();
expect(el.innerHTML).toBe(mainTemplate);

expect(el.innerHTML).toBe(
mainTemplate.replace(
"<span>History:</span>",
`<span>History:</span><p id="Moscow">Moscow</p>`,
),
);
});
});

0 comments on commit c114754

Please sign in to comment.