Conferences stop notifying once you are Tier 1 (#101)

After the Tier 1 goal, the 30-day reminders, the report (and its coin sound)
on the day and the sales engineer's booking notes are no longer shown or
logged. Registering, sponsoring, the glow, raffles and capacity deals work as
before, and the Deals tab still lists conferences.

Fixes #101
This commit is contained in:
Frederic Jung 2026-11-11 18:37:18 +01:00
parent 99b16f6184
commit 9c26d03952
No known key found for this signature in database
5 changed files with 54 additions and 5 deletions

View file

@ -0,0 +1,45 @@
// #101: once you have made Tier 1, conferences stop announcing themselves: no 30-day reminders, no report when one
// happens, no note from the sales engineer who booked it. What they do is unchanged, and the Deals panel still lists them.
const test = require('node:test');
const assert = require('node:assert/strict');
const { load } = require('./harness');
const setup = t1 => {
const r = load();
r.ev("ACT.start({});S.cash=1e9;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'})");
r.ev(t1 ? 'S.done.t1=1' : 'delete S.done.t1');
// Record every notification the conference code raises (toasts land in the NOC log too, so this catches both).
r.ev("window.__t=[];const __o=toast;toast=(h,...a)=>{__t.push(String(h));return __o(h,...a)}");
return r;
};
// A non-capacity conference: the day 30 days before it, and the day itself.
const CF = "CONFS.find(c=>!c.cap)";
const run = (ev, reg) => ev(`(()=>{const cf=${CF},d=confDay(cf,0),k=confKey(cf,0);
S.day=d-30;confTick(d-30);${reg ? "S.confReg[k]=true;" : ''}S.day=d;confTick(d);return JSON.stringify(window.__t)})()`);
test('#101 before Tier 1, conferences still remind you and report back', () => {
const { ev, errors } = setup(false);
const t = JSON.parse(run(ev, true));
assert.ok(t.some(h => /comes to .* in 30 days/.test(h)), 'the 30-day reminder');
assert.ok(t.some(h => /You shook a lot of hands/.test(h)), 'the report on the day');
assert.deepEqual(errors, []);
});
test('#101 after Tier 1, conferences say nothing, but attending still works and the Deals panel still lists them', () => {
const { ev, errors } = setup(true);
const t = JSON.parse(run(ev, true));
assert.deepEqual(t, [], 'no reminder and no report');
assert.ok(ev('!!(S.conf&&S.conf.until>S.day)'), 'the conference still gave its glow');
assert.ok(ev(`(()=>{S.day=confDay(${CF},1)-20;return /Attend/.test(confSection())})()`), 'still listed in Deals');
assert.deepEqual(errors, []);
});
test('#101 after Tier 1, a sales engineer still books conferences, without telling you each time', () => {
const { ev, errors } = setup(true);
// Hand the desk an engineer and run the desk on the day 30 days before the next conference.
const booked = ev(`(()=>{const cf=${CF},d=confDay(cf,1),k=confKey(cf,1);S.day=d-30;
S.sales={p:'eng'};S.confReg={};salesDay(d-30);return !!S.confReg[k]})()`);
assert.equal(booked, true, 'the booking still happens');
assert.deepEqual(JSON.parse(ev('JSON.stringify(window.__t)')), []);
assert.deepEqual(errors, []);
});

View file

@ -377,7 +377,8 @@ test('Flood Season: attacks keep coming, grow, and only count when service held'
test('DKNOG in Copenhagen is on the conference calendar', () => {
const { ev, errors } = load();
ev("ACT.start({});S.cash=1e9;for(const g of GOALS)S.done[g.id]=0");
// Not Tier 1 yet: after that, conferences no longer report back (#101).
ev("ACT.start({});S.cash=1e9;for(const g of GOALS)S.done[g.id]=0;delete S.done.t1");
const cf = JSON.parse(ev("JSON.stringify(CONFS.find(c=>c.n==='DKNOG'))"));
assert.equal(cf.c, 'cph');
assert.equal(ev(`MONTHS[${cf.m}]`), 'Mar', 'held in March, like the real one');