18F/identity-idp

View on GitHub
app/javascript/packages/url/remove-unload-protection.spec.ts

Summary

Maintainability
A
0 mins
Test Coverage
import removeUnloadProtection from './remove-unload-protection';

describe('removeUnloadProtection', () => {
  afterEach(() => {
    window.onbeforeunload = null;
    window.onunload = null;
  });

  it('neutralizes navigation confirmation prompts', () => {
    window.onbeforeunload = () => {};
    window.onunload = () => {};

    removeUnloadProtection();

    expect(window.onbeforeunload).not.to.exist();
    expect(window.onunload).not.to.exist();
  });
});