Skip to content

Commit

Permalink
Fix StravaSync test
Browse files Browse the repository at this point in the history
  • Loading branch information
watsonbox committed Sep 21, 2024
1 parent 69550ff commit 901f29e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/__tests__/StravaSync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jest.mock('strava-v3', () => ({
},
}));

jest.mock('../Authentication', () => ({
Authentication: jest.fn().mockImplementation(() => ({
isAuthenticated: jest.fn().mockReturnValue(true)
})),
}));

describe('StravaSync', () => {
let plugin: StravaSync;
let app: App;
Expand Down Expand Up @@ -133,6 +139,7 @@ describe('StravaSync', () => {

await plugin.importNewActivities();

expect(plugin.authentication.isAuthenticated).toHaveBeenCalled();
expect(plugin.activitySerializer.serialize).toHaveBeenCalledTimes(2);
expect(plugin.settings.sync.lastActivityTimestamp).toBe(Math.floor(new Date('2023-04-16T18:00:00Z').getTime() / 1000));

Expand Down

0 comments on commit 901f29e

Please sign in to comment.