Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/lib/stores/oauth-providers.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { describe, it, expect } from 'vitest';
import { oAuthProviders } from './oauth-providers';

describe('oAuthProviders', () => {
it('should include TikTok provider', () => {
expect(oAuthProviders.tiktok).toBeDefined();
expect(oAuthProviders.tiktok.name).toBe('TikTok');
expect(oAuthProviders.tiktok.icon).toBe('tiktok');
expect(oAuthProviders.tiktok.docs).toBe('https://developers.tiktok.com/doc/login-kit-web');
expect(oAuthProviders.tiktok.component).toBeDefined();
});

it('should have all providers with required fields', () => {
Object.entries(oAuthProviders).forEach(([key, provider]) => {
expect(provider.name).toBeDefined();
expect(provider.icon).toBeDefined();
expect(provider.component).toBeDefined();
// docs is optional but should be a string if defined
if (provider.docs) {
expect(typeof provider.docs).toBe('string');
}
});
});

it('should have TikTok positioned alphabetically after tradeshiftBox and before twitch', () => {
const keys = Object.keys(oAuthProviders);
const tiktokIndex = keys.indexOf('tiktok');
const tradeshiftBoxIndex = keys.indexOf('tradeshiftBox');
const twitchIndex = keys.indexOf('twitch');

expect(tiktokIndex).toBeGreaterThan(tradeshiftBoxIndex);
expect(tiktokIndex).toBeLessThan(twitchIndex);
});
});
6 changes: 6 additions & 0 deletions src/lib/stores/oauth-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ export const oAuthProviders: Record<string, Provider> = {
docs: 'https://developers.tradeshift.com/docs/api',
component: Main
},
tiktok: {
name: 'TikTok',
icon: 'tiktok',
docs: 'https://developers.tiktok.com/doc/login-kit-web',
component: Main
},
twitch: {
name: 'Twitch',
icon: 'twitch',
Expand Down
Loading