Files
binect-js/tests/types.test.ts
tegwick b9aebb42f1 Add Binect SDK implementation, Explorer, and test suite
SDK (@binect/js):
- BinectClient with domain sub-clients (documents, sendings, accounts,
  attachments, invoices)
- HTTP Basic Auth, native fetch only (no runtime dependencies)
- TypeScript types matching Binect API vocabulary
- Status predicates and polling helpers in helpers.ts
- Structured error handling (BinectApiError, BinectAuthError)

Explorer:
- Standalone browser-based API explorer (explorer/index.html)
- Interactive testing without code

Tests:
- Unit tests for client, types, errors, helpers, http
- E2E tests for upload/delete and send/cancel workflows

Also includes:
- Architecture Decision Records (ADRs)
- Example DIN 5008 letter PDFs for testing
- API specification research notes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 23:10:34 +01:00

53 lines
1.5 KiB
TypeScript

import { describe, it, expect } from 'vitest';
import {
DocumentStatus,
EnvelopeType,
FrankingType,
ProductionCountry,
ResponseFormat,
} from '../src/types.js';
describe('Enums', () => {
describe('DocumentStatus', () => {
it('has correct values', () => {
expect(DocumentStatus.IN_PREPARATION).toBe(1);
expect(DocumentStatus.SHIPPABLE).toBe(2);
expect(DocumentStatus.PRODUCTION_QUEUE).toBe(3);
expect(DocumentStatus.PRINTING).toBe(4);
expect(DocumentStatus.SENT).toBe(5);
expect(DocumentStatus.CANCELED).toBe(6);
expect(DocumentStatus.ERRONEOUS).toBe(7);
});
});
describe('EnvelopeType', () => {
it('has correct values', () => {
expect(EnvelopeType.DINLANG).toBe('DINLANG');
expect(EnvelopeType.C4).toBe('C4');
});
});
describe('FrankingType', () => {
it('has correct values', () => {
expect(FrankingType.UNSPECIFIED).toBe('UNSPECIFIED');
expect(FrankingType.STANDARD_FRANKING).toBe('STANDARD_FRANKING');
expect(FrankingType.DV_FRANKING).toBe('DV_FRANKING');
});
});
describe('ProductionCountry', () => {
it('has correct values', () => {
expect(ProductionCountry.UNSPECIFIED).toBe('UNSPECIFIED');
expect(ProductionCountry.DE).toBe('DE');
expect(ProductionCountry.AT).toBe('AT');
});
});
describe('ResponseFormat', () => {
it('has correct values', () => {
expect(ResponseFormat.FULL).toBe('FULL');
expect(ResponseFormat.SHORT).toBe('SHORT');
});
});
});