add more stats to mobile profile
This commit is contained in:
@@ -124,6 +124,22 @@ test("public profile contains only the selected driver's sanitized aggregates",
|
||||
assert.equal(serialized.includes("secret-decoder"), false);
|
||||
});
|
||||
|
||||
test("public profile visibility removes disabled sections from the API payload", () => {
|
||||
const state = buildState();
|
||||
state.training.shares[0].visibility = { progress: false, achievements: false, performance: false, goals: false, history: false };
|
||||
const profile = buildPublicTrainingProfile(state, DRIVER_ONE_TOKEN, "");
|
||||
const classProfile = profile.classProfiles[0];
|
||||
|
||||
assert.deepEqual(profile.visibility, { progress: false, achievements: false, performance: false, goals: false, history: false });
|
||||
assert.equal(classProfile.goals.length, 0);
|
||||
assert.deepEqual(classProfile.channelStats, {});
|
||||
assert.equal("paceHistory" in classProfile.stats, false);
|
||||
assert.equal("achievements" in classProfile.stats, false);
|
||||
assert.equal("stintSummaries" in classProfile.stats, false);
|
||||
assert.equal("dailySummaries" in classProfile.stats, false);
|
||||
assert.equal(classProfile.stats.totalLaps, 4);
|
||||
assert.equal(classProfile.stats.bestLapMs, 16000);
|
||||
});
|
||||
test("public profile exposes only class-scoped development trends and achievements", () => {
|
||||
const now = Date.now();
|
||||
const state = buildState(now);
|
||||
|
||||
Reference in New Issue
Block a user