diff --git a/changelogs/unreleased/24927-custom-event-polyfill-test.yml b/changelogs/unreleased/24927-custom-event-polyfill-test.yml
new file mode 100644
index 0000000000000000000000000000000000000000..879c28a951e7673003d7383b408ea47124470641
--- /dev/null
+++ b/changelogs/unreleased/24927-custom-event-polyfill-test.yml
@@ -0,0 +1,4 @@
+---
+title: Adds tests for custom event polyfill
+merge_request: 7996
+author:
diff --git a/spec/javascripts/lib/utils/custom_event_polyfill_spec.js.es6 b/spec/javascripts/lib/utils/custom_event_polyfill_spec.js.es6
new file mode 100644
index 0000000000000000000000000000000000000000..ad51367bb3202df0c7fa4a3e757196330e4ee0be
--- /dev/null
+++ b/spec/javascripts/lib/utils/custom_event_polyfill_spec.js.es6
@@ -0,0 +1,43 @@
+//= require lib/utils/custom_event_polyfill
+
+describe('Custom Event Polyfill', () => {
+  it('should be defined', () => {
+    expect(window.CustomEvent).toBeDefined();
+  });
+
+  it('should create a `CustomEvent` instance', () => {
+    const e = new window.CustomEvent('foo');
+
+    expect(e.type).toEqual('foo');
+    expect(e.bubbles).toBe(false);
+    expect(e.cancelable).toBe(false);
+    expect(e.detail).toBe(null);
+  });
+
+  it('should create a `CustomEvent` instance with a `details` object', () => {
+    const e = new window.CustomEvent('bar', { detail: { foo: 'bar' } });
+
+    expect(e.type).toEqual('bar');
+    expect(e.bubbles).toBe(false);
+    expect(e.cancelable).toBe(false);
+    expect(e.detail.foo).toEqual('bar');
+  });
+
+  it('should create a `CustomEvent` instance with a `bubbles` boolean', () => {
+    const e = new window.CustomEvent('bar', { bubbles: true });
+
+    expect(e.type).toEqual('bar');
+    expect(e.bubbles).toBe(true);
+    expect(e.cancelable).toBe(false);
+    expect(e.detail).toBe(null);
+  });
+
+  it('should create a `CustomEvent` instance with a `cancelable` boolean', () => {
+    const e = new window.CustomEvent('bar', { cancelable: true });
+
+    expect(e.type).toEqual('bar');
+    expect(e.bubbles).toBe(false);
+    expect(e.cancelable).toBe(true);
+    expect(e.detail).toBe(null);
+  });
+});