19 lines
1.3 KiB
TypeScript
19 lines
1.3 KiB
TypeScript
// "Open in Google Play Console" from the desktop: the app's developer id comes from its status (config / profile) or
|
|
// its Play account; the link is the shared console-links builder.
|
|
import { expect, test } from 'bun:test';
|
|
import { playUrlFor } from '../src/ui/app-menu';
|
|
|
|
const DEV = '5550000000000000001', APP = '4970000000000000002';
|
|
const app = { key: 'p1', android: { account: 'play-acme', key: 'k', store: 'android', app: { id: 'com.example.app' } }, project: null } as never;
|
|
const data = (status: unknown, devOnAccount: string | null) => ({ statusFor: () => status, accounts: [{ id: 'play-acme', kind: 'play', developerId: devOnAccount }] }) as never;
|
|
|
|
test('status ids: the app dashboard', () => {
|
|
expect(playUrlFor(data({ app: { platforms: { android: { packageName: 'com.example.app', developerId: DEV, appId: APP } } } }, null), app))
|
|
.toBe(`https://play.google.com/console/u/0/developers/${DEV}/app/${APP}/app-dashboard`);
|
|
});
|
|
test('the Play account\'s developer id: its app list', () => {
|
|
expect(playUrlFor(data(null, DEV), app)).toBe(`https://play.google.com/console/u/0/developers/${DEV}/app-list`);
|
|
});
|
|
test('nothing known: the developer chooser', () => {
|
|
expect(playUrlFor(data(null, null), app)).toBe('https://play.google.com/console/u/0/developers');
|
|
});
|