IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Unverified Commit f19bcb05 authored by tilley14's avatar tilley14 Committed by GitHub
Browse files

Fixing failing asset definition tests (#71)

* Fixed test not calling the correct function

* Fixed client test to look at rows and not body
parent a2593fd4
......@@ -85,14 +85,14 @@ describe('GET assetTypes', () => {
.get('/api/v1/assetTypes')
.expect(200)
.then((res) => {
expect(res.body).toEqual(
expect(res.body.rows).toEqual(
expect.arrayContaining([
expect.objectContaining(EXPECTED_ASSET_TYPE1),
expect.objectContaining(EXPECTED_ASSET_TYPE2),
expect.objectContaining(EXPECTED_ASSET_TYPE3)
])
);
expect(res.body).toHaveLength(3);
expect(res.body.rows).toHaveLength(3);
});
});
});
......
const { findAssetTypes } = require('../assetDefinitions.controller');
const { getAssetTypes } = require('../assetDefinitions.controller');
const assetDefinitionsDb = require('../../db/assetDefinitions.db');
describe('assetDefinitions.controller.getAssetTypes', () => {
......@@ -22,8 +22,8 @@ describe('assetDefinitions.controller.getAssetTypes', () => {
});
it('returns all asset types in DB', async () => {
await findAssetTypes(req, res, next);
expect(res.json).toHaveBeenCalledWith(expectedAssetTypes);
await getAssetTypes(req, res, next);
expect(res.json).toHaveBeenCalledWith(data);
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment