consul/ui/packages/consul-ui/tests/unit/utils/get-form-name-property-test.js
Ronald 9d21736e9f
Add UI copyright headers files (#16614)
* Add copyright headers to UI files

* Ensure copywrite file ignores external libs
2023-03-14 09:18:55 -04:00

17 lines
545 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import getFormNameProperty from 'consul-ui/utils/get-form-name-property';
import { module, test } from 'qunit';
module('Unit | Utility | get form name property', function () {
// 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);
});
});