open-consul/ui-v2/tests/unit/utils/get-form-name-property-test.js
John Cowen 52a62f2b8d UI: New ACLs (#4789)
UI to accompany the new ACLs APIs
2018-10-19 08:45:05 -07:00

12 lines
438 B
JavaScript

import getFormNameProperty from 'consul-ui/utils/get-form-name-property';
import { module, test } from 'qunit';
module('Unit | Utility | get form name property');
// Replace this with your real tests.
test("it parses 'item[property]' to `['item',' property']`", function(assert) {
const expected = ['item', 'property'];
const actual = getFormNameProperty(`${expected[0]}[${expected[1]}]`);
assert.deepEqual(actual, expected);
});