Added more unit tests to increase code coverage

This commit is contained in:
Alex Janousek
2025-10-27 15:00:52 -04:00
parent 6c3a516aa6
commit c273d5dd6f
9 changed files with 446 additions and 1 deletions

View File

@@ -179,4 +179,25 @@ describe('Update content', () => {
});
test("It should handle fetch errors gracefully", async () => {
global.fetch.mockImplementationOnce(() =>
Promise.resolve({
ok: false,
status: 500,
json: () => Promise.resolve({})
})
);
window.NotifyModules.start();
const textbox = document.getElementById('template_content');
helpers.triggerEvent(textbox, 'input');
jest.runAllTimers();
expect(document.querySelector('[data-module="update-status"]')).not.toBeNull();
});
});