mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-23 09:29:14 -04:00
Added more unit tests to increase code coverage
This commit is contained in:
@@ -184,4 +184,15 @@ describe('announceUploadStatusFromElement', () => {
|
||||
// Still unchanged
|
||||
expect(srRegion.textContent).toBe('Old message');
|
||||
});
|
||||
|
||||
test('does nothing if upload-status-live element does not exist', () => {
|
||||
document.body.innerHTML = `
|
||||
<span id="upload-error" class="usa-sr-only">File upload failed</span>
|
||||
`;
|
||||
|
||||
expect(() => {
|
||||
announceUploadStatusFromElement();
|
||||
jest.advanceTimersByTime(300);
|
||||
}).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user