List stars in search and routes by the type their colour gives them, and say where archive positions come from
5333be6gave the star card an estimated type for the 383 695 stars the ETL files as "Unknown", but search rows, the route search index and the current-star route option still printed that literal: TRAPPIST-1 read "STAR · UNKNOWN" in search beside "Spectral type ~M8, from colour" on its card, audit #17's own symptom. spectralClassification (spectral.ts) now gives the catalogue's type, else the colour's marked "~", else nothing, and all three and the card's subtitle use it; a search row with nothing to add prints its kind alone rather than a trailing " · ". The neighbourhood note still read "Positions from measured parallaxes" after4c8e4a0placed 3 277 stars at the Exoplanet Archive's sy_dist, 343 of them without a usable parallax and 281 of those past 1 kpc — microlensing hosts such as OGLE-2005-BLG-390L at 6.6 kpc, from a lensing model. positionsNote now says so, with the count. Neither the note nor the census subtitle (audit #16) had a test: putting back "Hipparcos · Yale Bright Star · Gliese" passed all 775. In the app on :4302: the note reads "Positions from measured parallaxes, and for the 3,277 planet hosts only the NASA Exoplanet Archive places, from its distances. Grid marks the galactic plane through the Sun."; search reads "TRAPPIST-1 STAR · ~M8", "OGLE-2005-BLG-390L STAR", "Sirius STAR · A0M"; TRAPPIST-1's route option has subtitle "~M8". The scene spec gains an archive-placed fixture star. Controls, each failing its named test: the search row printing the raw type, keeping the separator with nothing after it, the route index and the current-star option printing the raw type, the note back to parallaxes only, the subtitle back to the old catalogue list (1 of 797 each), the note never counting the archive (2 of 797), and the classification without its estimate (3 of 797). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,10 @@ function starRecord(id: number, name: string): StarRecord {
|
||||
/** Enough "Iot ..." stars to fill the result list ahead of the moon Io, as the real index does. */
|
||||
const STARS: StarRecord[] = [
|
||||
...Array.from({ length: 12 }, (_, i) => starRecord(100 + i, `Iot Star ${i}`)),
|
||||
starRecord(1, 'Proxima Centauri')
|
||||
starRecord(1, 'Proxima Centauri'),
|
||||
// As the ETL files a Gaia star: no type, a BP−RP colour; and a star with neither.
|
||||
{ ...starRecord(2, 'TRAPPIST-1'), spectralType: 'Unknown', colorIndex: 4.902, colorSystem: 'BP-RP' },
|
||||
{ ...starRecord(3, 'KMT-2016-BLG-1107L'), spectralType: 'Unknown', colorIndex: null }
|
||||
];
|
||||
|
||||
const IO: BodyRecord = {
|
||||
@@ -109,6 +112,14 @@ describe('SearchComponent', () => {
|
||||
expect(resultNames()).toContain('Proxima Cen b');
|
||||
});
|
||||
|
||||
it("lists a star by the type its colour gives it where it has none, and never as \"Unknown\"", async () => {
|
||||
const kindLine = (): string => (element.querySelector('[data-testid="search-results"] button span:last-child')?.textContent ?? '').trim();
|
||||
await type('TRAPPIST-1');
|
||||
expect(kindLine()).toBe('Star · ~M8');
|
||||
await type('KMT-2016-BLG-1107L');
|
||||
expect(kindLine()).toBe('Star');
|
||||
});
|
||||
|
||||
it('shows nothing for a query that matches nothing', async () => {
|
||||
await type('zzzzz');
|
||||
expect(element.querySelector('[data-testid="search-results"]')).toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user