johnsylvain / pagine

✨ Client-side markdown website generator

Home Page:https://johnsylvain.github.io/pagine/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix testing for route changes

johnsylvain opened this issue · comments

Testing (via jest) is currently broken for checking route changes. We should be able to test content is being rendered properly when routes change.

/*
* TODO: Fix this unit test to change URL location
*/
it('should change view content on route change', () => {
var output;
window.location.url = '#/home';
output = $('#view').first().innerHTML.trim()
expect(output).toBe('<h2>home page</h2>');
window.location.url = '#/about';
output = $('#view').first().innerHTML.trim()
expect(output).toBe('<h2>about page</h2>')
});