Release v1.14.0 — monetization launch (E5-E8) #237

Merged
developer merged 54 commits from development into master 2026-07-10 10:11:02 +00:00
Showing only changes of commit 7ce8101cfa - Show all commits
+14
View File
@@ -108,6 +108,20 @@ describe('maybeShowInterstitial (client-mirrored gate)', () => {
expect(mocks.vkShowInterstitial).toHaveBeenCalledTimes(1); // only the hint ad fired expect(mocks.vkShowInterstitial).toHaveBeenCalledTimes(1); // only the hint ad fired
}); });
it('a hint-pushed ad restarts the vs_ai gap, so the next plain move is not over-served', async () => {
// The scenario the owner flagged: a vs_ai ad, then 20 min later a hinted move pushes an ad on
// its short gap, then a plain move 10 min after that must NOT fire — the shared timer restarted
// the 30-min vs_ai gap at the hint ad, so 10 min is not enough (it fires only 30 min after it).
const vsAi = { vsAi: true, online: true };
expect(await maybeShowInterstitial(ADS, 'move', vsAi)).toBe(true); // t0
vi.setSystemTime(BASE + 20 * 60_000); // +20 min: a hint pushes an ad on its 1-min gap
expect(await maybeShowInterstitial(ADS, 'hint', vsAi)).toBe(true);
vi.setSystemTime(BASE + 30 * 60_000); // +10 min after the hint ad
expect(await maybeShowInterstitial(ADS, 'move', vsAi)).toBe(false);
vi.setSystemTime(BASE + 50 * 60_000); // +30 min after the hint ad
expect(await maybeShowInterstitial(ADS, 'move', vsAi)).toBe(true);
});
it('uses the longer vs_ai cooldown for a vs_ai move', async () => { it('uses the longer vs_ai cooldown for a vs_ai move', async () => {
expect(await maybeShowInterstitial(ADS, 'move', { vsAi: true, online: true })).toBe(true); expect(await maybeShowInterstitial(ADS, 'move', { vsAi: true, online: true })).toBe(true);
vi.setSystemTime(BASE + 1_799_000); // +1799s < the 1800s vs_ai cooldown vi.setSystemTime(BASE + 1_799_000); // +1799s < the 1800s vs_ai cooldown