consul/ui-v2/tests/unit/utils/dom/normalize-event-test.js
John Cowen 7d89e519a2 UI: New ACLs (#4789)
UI to accompany the new ACLs APIs
2018-10-19 08:45:05 -07:00

16 lines
608 B
JavaScript

import domNormalizeEvent from 'consul-ui/utils/dom/normalize-event';
import { module, test } from 'qunit';
module('Unit | Utility | dom/normalize event');
test('it returns the same object if target is defined', function(assert) {
const expected = { target: true };
const actual = domNormalizeEvent(expected, 'value');
assert.deepEqual(actual, expected);
});
test('it returns an event-like object if target is undefined', function(assert) {
const expected = { target: { name: 'name', value: 'value' } };
const actual = domNormalizeEvent('name', 'value');
assert.deepEqual(actual, expected);
});