* feat: import Fortnox voucher attachments * fix: show Fortnox document import follow-up * fix: harden optional Fortnox document import * test: pin optional Fortnox import flow * fix: use browser timer handle type * fix: avoid serializing OAuth resume state
21 lines
632 B
TypeScript
21 lines
632 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { buildFortnoxAuthUrl } from '../oauth';
|
|
|
|
describe('Fortnox OAuth scopes', () => {
|
|
it('requests archive and file-connection access by default', () => {
|
|
const url = new URL(
|
|
buildFortnoxAuthUrl({
|
|
clientId: 'client-id',
|
|
clientSecret: 'client-secret',
|
|
redirectUri: 'https://accounted.example.test/callback',
|
|
}),
|
|
);
|
|
const scopes = new Set(url.searchParams.get('scope')?.split(' ') ?? []);
|
|
|
|
expect(scopes).toContain('bookkeeping');
|
|
expect(scopes).toContain('archive');
|
|
expect(scopes).toContain('connectfile');
|
|
});
|
|
});
|