Skip to content

Commit

Permalink
Update getId.test.ts
Browse files Browse the repository at this point in the history
Added one more test case

Signed-off-by: Agajan Jumakuliyev <agajan.tm@gmail.com>
  • Loading branch information
agajassi committed Feb 25, 2025
1 parent be90e59 commit d4987e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/test/drm/fairplay/getId.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ import { strictEqual } from 'node:assert';
import { describe, it } from 'node:test';

describe('getId', () => {
it('extracts contentId from skd:// format', () => {
const laUrl = 'https://common-media-library.com';
const initDataString = 'skd://common-media-library.com/asset1234';
const initData = new TextEncoder().encode(initDataString);

strictEqual(getId(laUrl, initData), 'common-media-library.com/asset1234');
});

it('extracts query param when provided', () => {
const laUrl = 'https://common-media-library.com?videoId=svta-cml';
const initData = new Uint16Array();
Expand Down

0 comments on commit d4987e2

Please sign in to comment.