mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
* Moving entityGetter to utility folder * Import whitespace and if statement braces * newlines between multi-line if's
17 lines
394 B
JavaScript
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);
|
|
});
|
|
});
|