mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-22 23:16:46 +00:00
test(tours): the inventories count the region requests and the new admin notice
ENT-003 counts 142 entities and CLASSFIELD-002 494 uninitialised NOT NULL scalars with paddle_region_requests (region_id, name, reason) in, and NPREF-005b expects paddle_region_requested among the admin scoped events.
This commit is contained in:
@@ -38,14 +38,15 @@ describe('ALL_ENTITIES', () => {
|
||||
* + user_sessions, the session rows behind revocable session tokens
|
||||
* + ferrata_tiles, the stored via ferrata grid cells
|
||||
* + paddle_regions, paddle_features and tour_obstacle_reviews, the paddle obstacle data and decisions
|
||||
* + trip_journal_links and trip_journal_link_members, the journal a trip shows and who it is open to)
|
||||
* + trip_journal_links and trip_journal_link_members, the journal a trip shows and who it is open to
|
||||
* + paddle_water_graphs and paddle_region_requests, a region's water network and the regions that wait for an admin)
|
||||
* is registered, and no two share a class name (a silent duplicate would
|
||||
* shadow one of them in `orm.getMetadata()`, exactly the kind of drift
|
||||
* `entity-schema-parity.test.ts` can't see — it iterates the metadata map,
|
||||
* which de-duplicates by class name).
|
||||
*/
|
||||
it('ENT-003: exactly 141 entities, every class name unique', () => {
|
||||
expect(ALL_ENTITIES.length).toBe(141);
|
||||
it('ENT-003: exactly 142 entities, every class name unique', () => {
|
||||
expect(ALL_ENTITIES.length).toBe(142);
|
||||
const names = ALL_ENTITIES.map((s) => s.meta.className);
|
||||
expect(new Set(names).size).toBe(names.length);
|
||||
});
|
||||
|
||||
@@ -33,7 +33,8 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest';
|
||||
// added_at (a link and its members are always written whole).
|
||||
// + paddle_water_graphs: file, rev, bytes, built_at, stats and its bounding box (a network is only ever written
|
||||
// whole, from one build of its region).
|
||||
const KNOWN_UNINITIALISED_NOT_NULL_SCALARS = 491;
|
||||
// + paddle_region_requests: region_id, name, reason (a request is only ever filed whole).
|
||||
const KNOWN_UNINITIALISED_NOT_NULL_SCALARS = 494;
|
||||
|
||||
describe('entity class fields never carry a NaN initialiser (task-4-review-shape.md, Important 1)', () => {
|
||||
it('CLASSFIELD-001: new X() has no own property whose value is NaN, across all 133 entities', () => {
|
||||
|
||||
@@ -166,7 +166,8 @@ describe('getPreferencesMatrix', () => {
|
||||
const { event_types } = await getPreferencesMatrix(user.id, 'admin', 'admin');
|
||||
expect(event_types).toContain('version_available');
|
||||
expect(event_types).toContain('replica_failure');
|
||||
expect(event_types.length).toBe(2);
|
||||
expect(event_types).toContain('paddle_region_requested');
|
||||
expect(event_types.length).toBe(3);
|
||||
});
|
||||
|
||||
it('NPREF-006 — returns default true for all preferences when no stored prefs', async () => {
|
||||
|
||||
Reference in New Issue
Block a user