mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
fix(Spotify Node): Fix issue with null values breaking the response (#12080)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
1146
packages/nodes-base/nodes/Spotify/__tests__/workflow/apiResponses.ts
Normal file
1146
packages/nodes-base/nodes/Spotify/__tests__/workflow/apiResponses.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
import nock from 'nock';
|
||||
|
||||
import {
|
||||
getAlbum,
|
||||
getAlbumTracks,
|
||||
getArtist,
|
||||
getNewReleases,
|
||||
searchForAlbum,
|
||||
} from './apiResponses';
|
||||
import {
|
||||
setup,
|
||||
equalityTest,
|
||||
workflowToTests,
|
||||
getWorkflowFilenames,
|
||||
} from '../../../../test/nodes/Helpers';
|
||||
|
||||
describe('Spotify', () => {
|
||||
describe('Run workflow', () => {
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
|
||||
const mock = nock('https://api.spotify.com/v1');
|
||||
mock
|
||||
.get('/search')
|
||||
.query({ q: 'From Xero', type: 'album', limit: 2 })
|
||||
.reply(200, searchForAlbum);
|
||||
mock.get('/browse/new-releases').query({ limit: 2 }).reply(200, getNewReleases);
|
||||
mock.get('/albums/4R6FV9NSzhPihHR0h4pI93/tracks').reply(200, getAlbumTracks);
|
||||
mock.get('/albums/4R6FV9NSzhPihHR0h4pI93').reply(200, getAlbum);
|
||||
mock.get('/artists/12Chz98pHFMPJEknJQMWvI').reply(200, getArtist);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
test(testData.description, async () => await equalityTest(testData, nodeTypes));
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user