feat(audio): fewer personal best calls in Open Practice
On fresh packs every driver beats their best almost every lap early in the day. No call for a driver's first 10 laps since the practice started or was reset, at most one per driver a minute, and 0.1 s over the last called time. Adjustable under Settings → Audio; 0 turns a rule off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
633e0efa1f
commit
cade201d5a
10 files changed
+135
-2
No files matched your search
@@ -57,6 +57,15 @@ export async function runSettingsTabsSmoke({ evaluate, navigate, waitFor, savedS
|
||||
assert.equal(await callouts(), "passing");
|
||||
console.log("PASS the legacy audio panel is gone and race calls default to passing tone only");
|
||||
|
||||
// Open Practice personal best calls: 10 warm-up laps, 60 s, 0.1 s by default, and they save.
|
||||
const pbFields = () => evaluate(`["raceAudioPbWarmup", "raceAudioPbCooldown", "raceAudioPbMinGain"].map((name) => document.querySelector('[name="' + name + '"]').value).join("|")`);
|
||||
assert.equal(await pbFields(), "10|60|0.1");
|
||||
await evaluate(`(() => { document.querySelector('[name="raceAudioPbWarmup"]').value = "5"; document.querySelector('[name="raceAudioPbCooldown"]').value = "120"; document.querySelector('[name="raceAudioPbMinGain"]').value = "0.25"; document.getElementById("settingsForm").requestSubmit(); })()`);
|
||||
await waitFor(async () => { const audio = (await savedState()).settings.raceAudio; return audio.practicePbWarmupLaps === 5 && audio.practicePbCooldownSec === 120 && audio.practicePbMinGainMs === 250; }, "practice personal best rules saved");
|
||||
assert.equal(await pbFields(), "5|120|0.25");
|
||||
await evaluate(`(() => { document.querySelector('[name="raceAudioPbWarmup"]').value = "10"; document.querySelector('[name="raceAudioPbCooldown"]').value = "60"; document.querySelector('[name="raceAudioPbMinGain"]').value = "0.1"; document.getElementById("settingsForm").requestSubmit(); })()`);
|
||||
console.log("PASS the practice personal best call rules default to 10 laps / 60 s / 0.1 s and are saved");
|
||||
|
||||
// The sidebar "update available" link opens Settings on System & backup at Updates, even
|
||||
// when another tab was the last one used.
|
||||
await evaluate(`document.querySelector('[data-settings-tab="connection"]').click()`);
|
||||
|
||||
Reference in new issue
Block a user