diff --git a/package.json b/package.json index 9d82bf41c..d854f7ae0 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "test:e2e:chrome": "playwright test --project=chrome", "test:e2e:msedge": "playwright test --project=msedge", "test:e2e:report": "playwright show-report tests/e2e/playwright-report", - "test:ci": "pnpm test -- --reporters=default --reporters=github-actions" + "test:ci": "jest --reporters=default --reporters=github-actions" }, "dependencies": { "@interledger/open-payments": "^7.0.0", diff --git a/src/background/utils.test.ts b/src/background/utils.test.ts index 389938c88..569e171c8 100644 --- a/src/background/utils.test.ts +++ b/src/background/utils.test.ts @@ -125,12 +125,12 @@ describe('convertWithExchangeRate', () => { to: 'GBP', amounts: [ { input: '1', expected: '1' }, - { input: '10', expected: '9' }, + { input: '10', expected: '8' }, { input: '100', expected: '81' }, { input: '10000', expected: '8065' }, - { input: '15', expected: '13' }, + { input: '15', expected: '12' }, { input: '2', expected: '2' }, - { input: '200', expected: '162' }, + { input: '200', expected: '161' }, ], }, { @@ -140,12 +140,12 @@ describe('convertWithExchangeRate', () => { amounts: [ { input: '1', expected: '1' }, { input: '10', expected: '10' }, - { input: '100', expected: '97' }, - { input: '10000', expected: '9616' }, - { input: '15', expected: '15' }, + { input: '100', expected: '96' }, + { input: '10000', expected: '9615' }, + { input: '15', expected: '14' }, { input: '2', expected: '2' }, - { input: '200', expected: '193' }, - { input: 200n, expected: 193n }, + { input: '200', expected: '192' }, + { input: 200n, expected: 192n }, ], }, { @@ -156,11 +156,11 @@ describe('convertWithExchangeRate', () => { { input: '1', expected: '21' }, { input: '10', expected: '206' }, { input: '100', expected: '2058' }, - { input: '10000', expected: '205762' }, + { input: '10000', expected: '205761' }, { input: '15', expected: '309' }, - { input: '2', expected: '42' }, - { input: '200', expected: '4116' }, - { input: 200n, expected: 4116n }, + { input: '2', expected: '41' }, + { input: '200', expected: '4115' }, + { input: 200n, expected: 4115n }, ], }, { @@ -183,12 +183,12 @@ describe('convertWithExchangeRate', () => { from: 'GBP', to: 'USD', amounts: [ - { input: '1', expected: '2' }, - { input: '10', expected: '13' }, + { input: '1', expected: '1' }, + { input: '10', expected: '12' }, { input: '100', expected: '124' }, { input: '10000', expected: '12400' }, { input: '15', expected: '19' }, - { input: '2', expected: '3' }, + { input: '2', expected: '2' }, { input: '200', expected: '248' }, ], }, @@ -198,13 +198,13 @@ describe('convertWithExchangeRate', () => { to: 'JPY', toAssetScale: 3, amounts: [ - { input: '1', expected: '1539' }, + { input: '1', expected: '1538' }, { input: '10', expected: '15385' }, - { input: '100', expected: '153847' }, - { input: '10000', expected: '15384616' }, + { input: '100', expected: '153846' }, + { input: '10000', expected: '15384615' }, { input: '15', expected: '23077' }, { input: '2', expected: '3077' }, - { input: '200', expected: '307693' }, + { input: '200', expected: '307692' }, ], }, ]; diff --git a/src/content/__tests__/monetizationLinkManager.test.ts b/src/content/__tests__/monetizationLinkManager.test.ts index e9b329d07..ac26dfd56 100644 --- a/src/content/__tests__/monetizationLinkManager.test.ts +++ b/src/content/__tests__/monetizationLinkManager.test.ts @@ -1172,7 +1172,9 @@ describe('document events', () => { await nextTick(); const requestId = 'uuid-1'; - expect(msg.STOP_MONETIZATION).toHaveBeenCalledWith([{ requestId }]); + expect(msg.STOP_MONETIZATION).toHaveBeenCalledWith([ + { requestId, intent: 'pause' }, + ]); documentVisibilityState.mockReturnValueOnce('visible'); document.dispatchEvent(new window.Event('visibilitychange'));