Skip to content

Commit

Permalink
adjust tests to API v4
Browse files Browse the repository at this point in the history
  • Loading branch information
fewieden committed Feb 13, 2024
1 parent df8a622 commit 8adf20a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions __tests__/node_helper.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ describe('node_helper', () => {
test('triggers data fetch without api_key if notification is GET_DATA', () => {
helper.socketNotificationReceived('GET_DATA', {league: 'BL1'});

expect(fetchMock).toHaveBeenNthCalledWith(1, 'http://api.football-data.org/v2/competitions/BL1/standings', {});
expect(fetchMock).toHaveBeenNthCalledWith(1, 'http://api.football-data.org/v4/competitions/BL1/standings', {});
});

test('triggers data fetch with api key if notification is GET_DATA', () => {
const apiKey = 'TEST_API_KEY';
helper.socketNotificationReceived('GET_DATA', {league: 'BL1', api_key: apiKey});

expect(fetchMock).toHaveBeenNthCalledWith(1, 'http://api.football-data.org/v2/competitions/BL1/standings', {
expect(fetchMock).toHaveBeenNthCalledWith(1, 'http://api.football-data.org/v4/competitions/BL1/standings', {
headers: {
'X-Auth-Token': apiKey
}
Expand Down

0 comments on commit 8adf20a

Please sign in to comment.