fix: 2026-06-04 audit pass — README, USB pack, multi-area fixes
WS ticket dashboard auth, builder universal signing/size limits/fusion obfuscation/dropper bundles, Path Tracer WireGuard topology, SessionGate degraded mode and download timeouts, server bootstrap (data dir, cloudflared dedupe, config port precedence), agent mesh/miner/spread fixes. README refreshed; usb bundle repacked; PROBLEMS.md audit log updated.
This commit is contained in:
@@ -5,8 +5,6 @@ import {
|
||||
resolveChartSeries,
|
||||
chartSeriesDelta,
|
||||
chartSeriesPeak,
|
||||
SAMPLE_CONTRIBUTION_BARS,
|
||||
SAMPLE_FLEET_PREVIEW,
|
||||
} from './chartSampleData';
|
||||
|
||||
describe('chartSampleData', () => {
|
||||
@@ -20,44 +18,23 @@ describe('chartSampleData', () => {
|
||||
expect(chartSeriesPeak(series)).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('hashrate sample trends upward (mining ramp)', () => {
|
||||
const series = generateSampleSeries('hashrate', 48);
|
||||
expect(series[series.length - 1].value).toBeGreaterThan(series[0].value);
|
||||
const delta = chartSeriesDelta(series);
|
||||
expect(delta).not.toBeNull();
|
||||
expect(delta!).toBeGreaterThan(0);
|
||||
it('resolveChartSeries returns empty when live is empty', () => {
|
||||
const { data, mode } = resolveChartSeries([]);
|
||||
expect(mode).toBe('empty');
|
||||
expect(data).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('accept sample stays in realistic pool band', () => {
|
||||
const series = generateSampleSeries('accept', 48);
|
||||
for (const p of series) {
|
||||
expect(p.value).toBeGreaterThanOrEqual(90);
|
||||
expect(p.value).toBeLessThanOrEqual(100);
|
||||
}
|
||||
});
|
||||
|
||||
it('resolveChartSeries uses sample when live is empty', () => {
|
||||
const { data, mode } = resolveChartSeries([], 'hashrate');
|
||||
expect(mode).toBe('sample');
|
||||
expect(data.length).toBe(48);
|
||||
expect(validateChartSeries(data).ok).toBe(true);
|
||||
});
|
||||
|
||||
it('resolveChartSeries prefers live when enough points', () => {
|
||||
const live = generateSampleSeries('cpu', 20).map((p, i) => ({
|
||||
...p,
|
||||
value: 40 + i * 0.5,
|
||||
}));
|
||||
const { data, mode } = resolveChartSeries(live, 'cpu');
|
||||
it('resolveChartSeries returns live slice when data exists', () => {
|
||||
const live = generateSampleSeries('cpu', 20);
|
||||
const { data, mode } = resolveChartSeries(live);
|
||||
expect(mode).toBe('live');
|
||||
expect(data.length).toBe(20);
|
||||
});
|
||||
|
||||
it('preview constants are internally consistent', () => {
|
||||
const totalPct = SAMPLE_CONTRIBUTION_BARS.reduce((s, b) => s + b.pct, 0);
|
||||
expect(totalPct).toBeGreaterThan(98);
|
||||
expect(totalPct).toBeLessThan(102);
|
||||
expect(SAMPLE_FLEET_PREVIEW.hashrate).toBeGreaterThan(50_000);
|
||||
expect(SAMPLE_FLEET_PREVIEW.xmrPerDay).toBeGreaterThan(0);
|
||||
it('chartSeriesDelta computes trend', () => {
|
||||
const series = generateSampleSeries('hashrate', 48);
|
||||
const delta = chartSeriesDelta(series);
|
||||
expect(delta).not.toBeNull();
|
||||
expect(delta!).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user