github.com/sl1pm4t/consul@v1.4.5-0.20190325224627-74c31c540f9c/ui-v2/tests/unit/utils/update-array-object-test.js (about) 1 import updateArrayObject from 'consul-ui/utils/update-array-object'; 2 import { module, test } from 'qunit'; 3 4 module('Unit | Utility | update array object'); 5 6 // Replace this with your real tests. 7 test('it works', function(assert) { 8 const expected = { 9 data: { 10 id: '2', 11 name: 'expected', 12 }, 13 }; 14 const arr = [ 15 { 16 data: { 17 id: '1', 18 name: 'name', 19 }, 20 }, 21 { 22 data: { 23 id: '2', 24 name: '-', 25 }, 26 }, 27 ]; 28 const actual = updateArrayObject(arr, expected, 'id'); 29 assert.ok(actual, expected); 30 });