# test.web/domain/converters/grammar.section.converter.test.ts

> 11 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-web-domain-converters-grammar-section-converter-test-ts
Source text: https://banes-lab.com/source/testing/test.web/domain/converters/grammar.section.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/failure.converter.test.ts](https://banes-lab.com/source/testing/test.web/domain/converters/failure.converter.test.ts.md) and before [test.web/domain/converters/home.converter.test.ts](https://banes-lab.com/source/testing/test.web/domain/converters/home.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 { ONTOLOGY } from "@banes-lab/web/core/generated/ontology.generated.ts";
import { grammarSections } from "@banes-lab/web/domain/converters/grammar.section.converter.ts";

describe("grammarSections", () => {
    it("renders a section per keyword category and production group, then the document types and the templates", () => {
        const { grammar, resolution } = ONTOLOGY;
        const sections = grammarSections(grammar, resolution);
        expect(sections).toHaveLength(grammar.categories.length + grammar.groups.length + 2);
        expect(sections.at(-1)?.subsections).toHaveLength(grammar.templates.length);
    });
});
```
