Build a body still waiting for its surface with a null map, so three stops warning on each one
Since de34fff paints derived surfaces after the system is built, every body without a photograph
was given map: undefined, and three's Material.setValues warns "parameter 'map' has value of
undefined" for each: eleven warnings every time the Sun's system was entered, one per exoplanet in
any other. The marker now starts with map: null, which three takes without a word and which
the deferred paint replaces as before. In the running app, entering the Sun (38 members) now logs
no console message at all.
Control: undefined again fails "builds a body still waiting for its surface without three warning
of an undefined map".
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as THREE from 'three/webgpu';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { DEFAULT_EPOCH_JD, GM_SUN_AU3_PER_DAY2, TT_MINUS_UTC_DAYS, ttMinusUtSeconds } from '../../shared/astro/constants';
|
||||
import { keplerRates } from '../../shared/astro/kepler';
|
||||
@@ -465,6 +465,13 @@ describe('derived surfaces', () => {
|
||||
renderer.dispose();
|
||||
});
|
||||
|
||||
it('builds a body still waiting for its surface without three warning of an undefined map', () => {
|
||||
const warn = vi.spyOn(console, 'warn');
|
||||
twoPlanets().dispose();
|
||||
expect(warn.mock.calls.flat().join(' ')).not.toContain("parameter 'map'");
|
||||
warn.mockRestore();
|
||||
});
|
||||
|
||||
it('paints nothing once the system is left', async () => {
|
||||
const renderer = twoPlanets();
|
||||
renderer.dispose();
|
||||
|
||||
Reference in New Issue
Block a user