# test.build/core/converters/architecture.index.converter.test.ts

> 22 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-build-core-converters-architecture-index-converter-test-ts
Source text: https://banes-lab.com/source/testing/test.build/core/converters/architecture.index.converter.test.ts.txt

Listed in [test.build/core/converters](https://banes-lab.com/api/source/testing/test.build/core/converters.md), after [test.build/core/converters/anatomy.index.converter.test.ts](https://banes-lab.com/source/testing/test.build/core/converters/anatomy.index.converter.test.ts.md) and before [test.build/core/converters/base.converter.test.ts](https://banes-lab.com/source/testing/test.build/core/converters/base.converter.test.ts.md).

## Contained in

- [test.build/core/converters](https://banes-lab.com/anatomy/testing/folder-testing-test-build-core-converters.md)

## Source

```typescript
import {
    archIndexOf,
    categoryLabelsOf,
} from "@banes-lab/build-scripts/core/converters/architecture.index.converter.ts";
import { createGovlabContext, slugify } from "@govlab/context";
import { describe, expect, it } from "vitest";

const context = createGovlabContext();

describe("archIndexOf", () => {
    it("finds a principle by its id, its name and each alias, all slugged", () => {
        const index = archIndexOf(context);
        const principle = context.arch.get("single-responsibility");
        expect(index.get("single-responsibility")).toBe(principle);
        expect(index.get(slugify(principle?.name ?? ""))).toBe(principle);
    });
});

describe("categoryLabelsOf", () => {
    it("maps every category slug to the label the principles carry", () => {
        const labels = categoryLabelsOf(context);
        const [first] = context.arch.all();
        expect(labels.get(slugify(first?.category ?? ""))).toBe(first?.category);
    });
});
```
