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

31 lines
575 B
JavaScript

import updateArrayObject from 'consul-ui/utils/update-array-object';
import { module, test } from 'qunit';
module('Unit | Utility | update array object');
// Replace this with your real tests.
test('it works', function(assert) {
const expected = {
data: {
id: '2',
name: 'expected',
},
};
const arr = [
{
data: {
id: '1',
name: 'name',
},
},
{
data: {
id: '2',
name: '-',
},
},
];
const actual = updateArrayObject(arr, expected, 'id');
assert.ok(actual, expected);
});