Versie 0.3.2
This commit is contained in:
1 parent
e77d8fd373
commit
1cf6eeed29
16 files changed
+551
-44
No files matched your search
@@ -1,4 +1,4 @@
|
||||
// Generated, do not edit. sha256:6129a8bbffc98b951f97ab835b37848de841b315ab86079ee5c45996f7fe3fe5
|
||||
// Generated, do not edit. sha256:48e4432f919c88e3f0adaad52e46a88287459c06124c6a46c43d717bfbc8d8d8
|
||||
import { describe, it, beforeEach, mock } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
@@ -27,8 +27,10 @@ mock.module('../../client/data/_rpc.js', {
|
||||
},
|
||||
});
|
||||
|
||||
const { loadLicense, licenseFingerprint, licenseChangedSinceSeen, markLicenseSeen } =
|
||||
const { loadLicense, licenseFingerprint, licenseChangedSinceSeen, markLicenseSeen, counterText } =
|
||||
await import('../../client/license.js');
|
||||
const { setLocale } = await import('../../client/i18n/index.js');
|
||||
const { CONFIG } = await import('../../shared/config.js');
|
||||
|
||||
const GRATIS = {
|
||||
level: 'free', why: 'none', enforced: true, version: '1.0.0', installed: null,
|
||||
@@ -94,3 +96,24 @@ describe('is er iets te melden', () => {
|
||||
assert.equal(await licenseChangedSinceSeen(), false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('de teller naast de plus', () => {
|
||||
it('noemt wat hij telt, voor elke grens van de gratis editie en in elke taal', async () => {
|
||||
const max = Object.fromEntries(Object.keys(CONFIG.LICENSE.FREE.MAX).map(k => [k, 1]));
|
||||
stand = { ...GRATIS, max };
|
||||
await loadLicense();
|
||||
try {
|
||||
for (const taal of ['nl', 'en']) {
|
||||
setLocale(taal);
|
||||
for (const soort of Object.keys(max)) assert.match(counterText(soort, 0), /^\S.*: 0 \S+ 1$/, `${taal}, ${soort}`);
|
||||
}
|
||||
} finally { setLocale('nl'); }
|
||||
assert.equal(counterText('assets', 1), 'Assets naast valuta in de gratis editie: 1 van 1');
|
||||
});
|
||||
|
||||
it('valt weg zonder grens', async () => {
|
||||
stand = BETAALD;
|
||||
await loadLicense();
|
||||
assert.equal(counterText('assets', 1), null);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user