Files
DndGamePlayer/app/shared/license/productKey.test.ts
T
Ivan Fontosh 7c858ba633 feat(phase1): rebrand to TTRPG Player and drop Git updates feed
Rename product to TTRPG Player (TTRPGPlayer / com.ttrpgplayer.app), use .ttrpg.zip for new saves while keeping .dnd.zip import, accept TTRPG- and DND- license keys on client, and remove sync-update-feed plus CI push to DndGamePlayerUpdates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-17 20:56:14 +08:00

21 lines
634 B
TypeScript

import assert from 'node:assert/strict';
import test from 'node:test';
import { isProductKey } from './productKey';
void test('isProductKey: legacy DND prefix', () => {
assert.equal(isProductKey('DND-CEBEC1BF-AD0B-4312-BFDD-675AFF5955FD'), true);
});
void test('isProductKey: TTRPG prefix', () => {
assert.equal(isProductKey('TTRPG-CEBEC1BF-AD0B-4312-BFDD-675AFF5955FD'), true);
});
void test('isProductKey: token with dot — no', () => {
assert.equal(isProductKey('eyJ.xxx'), false);
});
void test('isProductKey: trimmed', () => {
assert.equal(isProductKey(' TTRPG-CEBEC1BF-AD0B-4312-BFDD-675AFF5955FD '), true);
});