# test.web/domain/converters/loop.converter.test.ts

> 13 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-web-domain-converters-loop-converter-test-ts
Source text: https://banes-lab.com/source/testing/test.web/domain/converters/loop.converter.test.ts.txt

Listed in [test.web/domain/converters](https://banes-lab.com/api/source/testing/test.web/domain/converters.md), after [test.web/domain/converters/link.converter.test.ts](https://banes-lab.com/source/testing/test.web/domain/converters/link.converter.test.ts.md) and before [test.web/domain/converters/ontology.converter.test.ts](https://banes-lab.com/source/testing/test.web/domain/converters/ontology.converter.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import { loopSection, modelSection, substrateSection } from "@banes-lab/web/domain/converters/loop.converter.ts";
import { ONTOLOGY } from "@banes-lab/web/core/generated/ontology.generated.ts";

const { reason, resolution } = ONTOLOGY;

describe("loopSection, substrateSection and modelSection", () => {
    it("renders one subsection per stage plus the loop, per substrate node and per model", () => {
        const loop = loopSection(reason, resolution);
        expect(loop.subsections).toHaveLength(reason.derivationLoop.stages.length + 1);
        expect(loop.subsections[0]?.id?.startsWith("stage-")).toBe(true);
        expect(substrateSection(reason, resolution).subsections).toHaveLength(reason.substrate.nodes.length);
        expect(modelSection(reason, resolution).subsections).toHaveLength(reason.models.length);
    });
});
```
