summaryrefslogtreecommitdiff
path: root/spec/javascripts/helpers/wait_for_attribute_change.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/helpers/wait_for_attribute_change.js')
-rw-r--r--spec/javascripts/helpers/wait_for_attribute_change.js16
1 files changed, 0 insertions, 16 deletions
diff --git a/spec/javascripts/helpers/wait_for_attribute_change.js b/spec/javascripts/helpers/wait_for_attribute_change.js
deleted file mode 100644
index 8f22d569222..00000000000
--- a/spec/javascripts/helpers/wait_for_attribute_change.js
+++ /dev/null
@@ -1,16 +0,0 @@
-export default (domElement, attributes, timeout = 1500) =>
- new Promise((resolve, reject) => {
- let observer;
- const timeoutId = setTimeout(() => {
- observer.disconnect();
- reject(new Error(`Could not see an attribute update within ${timeout} ms`));
- }, timeout);
-
- observer = new MutationObserver(() => {
- clearTimeout(timeoutId);
- observer.disconnect();
- resolve();
- });
-
- observer.observe(domElement, { attributes: true, attributeFilter: attributes });
- });