Skip to content

Commit

Permalink
Change API to api.jolpi.ca
Browse files Browse the repository at this point in the history
  • Loading branch information
marcokreeft87 committed Sep 13, 2024
1 parent 938c346 commit 67bb2d1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion formulaone-card.js

Large diffs are not rendered by default.

Binary file modified formulaone-card.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formulaone-card",
"version": "1.9.2",
"version": "1.9.3",
"description": "Frontend card for Home Assistant to display Formula One data",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/api/ergast-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ConstructorStanding, DriverStanding, Race, RaceTable, Root, Season } fr

export default class ErgastClient extends ClientBase {

baseUrl = 'https://ergast.com/api/f1';
baseUrl = 'https://api.jolpi.ca/ergast/f1';

async GetSchedule(season: number) : Promise<Race[]> {
const data = await this.GetData<Root>(`${season}.json`, true, 72);
Expand Down
18 changes: 9 additions & 9 deletions tests/cards/results.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ describe('Testing results file', () => {
card.setSelectedRace({ target: { value: '6' } });

// Assert
expect(fetchMock).toHaveBeenCalledWith("https://ergast.com/api/f1/2022/6/results.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://ergast.com/api/f1/2022/6/qualifying.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://ergast.com/api/f1/2022/6/sprint.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://api.jolpi.ca/ergast/f1/2022/6/results.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://api.jolpi.ca/ergast/f1/2022/6/qualifying.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://api.jolpi.ca/ergast/f1/2022/6/sprint.json", {"headers": {"Accept": "application/json"}});
}),
test('Calling setSelectedRace with selectedSeason undefined no results', async () => {
// Arrange
Expand All @@ -435,9 +435,9 @@ describe('Testing results file', () => {
card.setSelectedRace({ target: { value: '5' } });

// Assert
expect(fetchMock).toHaveBeenCalledWith("https://ergast.com/api/f1/2022/5/results.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://ergast.com/api/f1/2022/5/qualifying.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://ergast.com/api/f1/2022/5/sprint.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://api.jolpi.ca/ergast/f1/2022/5/results.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://api.jolpi.ca/ergast/f1/2022/5/qualifying.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://api.jolpi.ca/ergast/f1/2022/5/sprint.json", {"headers": {"Accept": "application/json"}});
}),
test('Calling setSelectedRace with selectedSeason undefined no results', async () => {
// Arrange
Expand All @@ -450,9 +450,9 @@ describe('Testing results file', () => {
card.setSelectedRace({ target: { value: '5' } });

// Assert
expect(fetchMock).toHaveBeenCalledWith("https://ergast.com/api/f1/2022/5/results.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://ergast.com/api/f1/2022/5/qualifying.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://ergast.com/api/f1/2022/5/sprint.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://api.jolpi.ca/ergast/f1/2022/5/results.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://api.jolpi.ca/ergast/f1/2022/5/qualifying.json", {"headers": {"Accept": "application/json"}});
expect(fetchMock).toHaveBeenCalledWith("https://api.jolpi.ca/ergast/f1/2022/5/sprint.json", {"headers": {"Accept": "application/json"}});
}),
test('Calling render without tab_order should arrange tabs in default order', async () => {
// Arrange
Expand Down

0 comments on commit 67bb2d1

Please sign in to comment.