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

Unverified Commit 7f0de63a authored by Anthony Palumbo's avatar Anthony Palumbo Committed by GitHub
Browse files

Pushing fixes to LWC tests. (#73)

parent f19bcb05
......@@ -15,7 +15,7 @@ describe('assetDefinitions.findAssetTypes', () => {
});
it('finds all asset types stored in the DB', async () => {
const assetTypes = await assetDefinitions.findAssetTypes();
const assetTypes = await assetDefinitions.fetchAssetTypes();
expect(fetch.mock.calls[0][0]).toBe(URL);
expect(assetTypes).toEqual(EXPECTED_ASSET_TYPES);
});
......@@ -42,4 +42,4 @@ describe('assetDefinitions.sendCSV', () => {
expect(fetch.mock.calls[0][0]).toBe(URL);
expect(response).toEqual(EXPECTED_RESPONSE);
});
});
\ No newline at end of file
});
......@@ -27,6 +27,16 @@ const post = (url, data) => {
}).then(handleFetchErrors);
};
const put = (url, data) => {
return fetch(url, {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
}).then(handleFetchErrors);
};
const putCSV = (url, assetTypeId, csvFile) => {
// Key-value pairs that represent form fields and corresponding values
const formData = new FormData();
......@@ -43,5 +53,6 @@ export default {
URL,
get,
post,
put,
putCSV
};
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