fleet/frontend/utilities/debounce/debounce.tests.js
Mike Arpaia c07702330d Cleaning JavaScript imports and if statements (#327)
* Moving entityGetter to utility folder

* Import whitespace and if statement braces

* newlines between multi-line if's
2016-10-19 16:22:18 -04:00

17 lines
394 B
JavaScript

import expect from 'expect';
import debounce from './index';
describe('debounce - utility', () => {
it('prevents double-clicks from executing a function multiple times', () => {
let count = 0;
const increaseCount = () => {
count += 1;
};
const debouncedFunc = debounce(increaseCount);
debouncedFunc();
debouncedFunc();
expect(count).toEqual(1);
});
});