# test.web/configuration/constants/methodology.constants.test.ts

> 31 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-web-configuration-constants-methodology-constants-test-ts
Source text: https://banes-lab.com/source/testing/test.web/configuration/constants/methodology.constants.test.ts.txt

Listed in [test.web/configuration/constants](https://banes-lab.com/api/source/testing/test.web/configuration/constants.md), after [test.web/configuration/constants/graph.constants.test.ts](https://banes-lab.com/source/testing/test.web/configuration/constants/graph.constants.test.ts.md) and before [test.web/configuration/constants/ontology.constants.test.ts](https://banes-lab.com/source/testing/test.web/configuration/constants/ontology.constants.test.ts.md).

## Contained in

- [test.web/configuration/constants](https://banes-lab.com/anatomy/testing/folder-testing-test-web-configuration-constants.md)

## Source

```typescript
import type { ContentGraph, GraphSection } from "@banes-lab/web/types/methodology.types.ts";
import { describe, expect, it } from "vitest";
import { METHODOLOGY_GRAPH } from "@banes-lab/web/configuration/constants/methodology.constants.ts";
import { METHODOLOGY_PAGE } from "@banes-lab/web/core/ids/page.ids.ts";
import { METHODOLOGY_TABS } from "@banes-lab/web/core/generated/methodology.page.generated.ts";

const graph: ContentGraph = METHODOLOGY_GRAPH;

describe("METHODOLOGY_GRAPH", () => {
    it("is keyed to the methodology page", () => {
        expect(graph.page).toBe(METHODOLOGY_PAGE);
    });

    it("carries one entry per section the page's tabs declare and none besides", () => {
        const declared = METHODOLOGY_TABS.flatMap((tab) => tab.sections.map((section) => section.id)).sort();
        expect(Object.keys(graph.sections).sort()).toStrictEqual(declared);
    });

    it("either teaches and traces a section or declares it narrative, never neither and never both", () => {
        const sections: GraphSection[] = Object.values(graph.sections);
        for (const section of sections) {
            if (section.narrative === true) {
                expect(section.teaches).toHaveLength(0);
                expect(section.traces).toHaveLength(0);
            } else {
                expect(section.teaches.length).toBeGreaterThan(0);
                expect(section.traces.length).toBeGreaterThan(0);
            }
        }
    });

    it("teaches every concept exactly once", () => {
        const taught = Object.values(graph.sections).flatMap((section) => section.teaches);
        expect(new Set(taught).size).toBe(taught.length);
    });
});
```
