---
id: TST-PFM-MTD-093
title: layout assignments table
kind: integration
product_area: platform
module: metadata
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js
implements:
  - ATS-PFM-MTD-008-08
  - ATS-PFM-MTD-008-09
  - ATS-PFM-MTD-008-10
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  Prepared integration database and the suite fixture records; fixture teardown restores or removes its own
  rows.
evidence:
  - 'services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js'
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#modules/layouts/db/layout-assignments.table.ts
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#stores
    the assignment under the slot’s own column and leaves the other four empty
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#stamps
    when the assignment was recorded
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a second assignment of the same slot in the same referring row, by the primary key
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#accepts
    a second slot in the same referring row, so one row may assign a layout and a form
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#holds
    a different console form for creating a record and for editing one, each under its own column
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#holds
    the same console form in both slots, which is what a record type names until somebody splits them
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#accepts
    an assignment of a definition that exists, with its own purpose and kind
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    an assignment naming a definition that does not exist
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    an assignment naming a definition of another tenant
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    an assignment naming a definition of another purpose
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    an assignment naming a definition of the wrong kind, because each slot’s column references one table
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a portal page layout slot naming a console page layout, by that slot’s own key
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a console create form slot naming a console page layout, by that slot’s own key
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a console edit form slot naming a console page layout, by that slot’s own key
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a console create form of another purpose, because that key carries the purpose too
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a console edit form of another purpose, because that key carries the purpose too
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a console create form that does not exist
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a console edit form that does not exist
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#accepts
    a console form of the referrer’s own purpose in each of the two console form slots
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a row that names the retired console_form slot and holds a console form, by the slot check
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a portal form slot naming a console page layout, by that slot’s own key
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#accepts
    each slot naming a definition of its own table, so the refusals above are about the kind
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a tenant that does not exist, by the tenant foreign key
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a referrer table that is not schema-qualified, by the referrer table check
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a purpose that is not an object id, by the purpose check
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a slot outside the five, by the slot check
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a row whose slot column holds nothing, so no row describes an assignment of nothing
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a row that fills two slots at once, so no row describes two assignments
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a console create form slot that fills the edit form column instead of its own
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a console edit form slot that fills the create form column instead of its own
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    a row that names the create and the edit form at once, so each slot stays one row
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    the delete while the assignment stands, by the slot’s foreign key
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#leaves
    the definition in place after the refusal
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#allows
    the delete once the assignment is removed
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    the delete of a console form assigned as a create form, by that slot’s own key
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    the delete of a console form assigned as an edit form, by that slot’s own key
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#allows
    the delete of a console form once both of its console form assignments are removed
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#held
    the definition and its assignment before the tenant was deleted
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#takes
    the assignment with the tenant, which a RESTRICT key would have refused
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#takes
    the definition with the tenant
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#holds
    both tenants’ assignments, read as the owner
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#reads
    only the acting tenant’s assignments
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#reads
    nothing at all with no tenant, so a statement outside a tenant fails closed
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
    an assignment written for another tenant, by the policy
  - >-
    services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#leaves
    the other tenant’s assignment in place after the refusal
fixture_imports:
  - drizzle-orm
  - ../../../db/console-page-layouts.table
  - ../../../db/console-forms.table
  - ../../../db/portal-forms.table
  - ../../../db/portal-page-layouts.table
  - ../../../db/layout-assignments.table
  - ../../../../tenants/db/tenants.table
  - ../support
  - '@rhythmsoftware/macroservice-testing/refusals'
  - '@rhythmsoftware/macroservice-testing/stage'
test_doubles: []
limitations: []
unmatched_specification: null
binding_assertions:
  - scenario: ATS-PFM-MTD-008-08
    provenance: test
    source:
      - >-
        services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
        an assignment naming a definition that does not exist
      - >-
        services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
        an assignment naming a definition of another tenant
      - >-
        services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
        an assignment naming a definition of another purpose
      - >-
        services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
        an assignment naming a definition of the wrong kind, because each slot’s column references one table
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
  - scenario: ATS-PFM-MTD-008-09
    provenance: test
    source:
      - >-
        services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#holds
        a different console form for creating a record and for editing one, each under its own column
      - >-
        services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#holds
        the same console form in both slots, which is what a record type names until somebody splits them
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
  - scenario: ATS-PFM-MTD-008-10
    provenance: test
    source:
      - >-
        services-platform:modules/layouts/tests/integration/db/layout-assignments.table.integration.spec.js#refuses
        the delete of a console form assigned as an edit form, by that slot’s own key
    note: >-
      These references identify the assertions this suite contributes; bindings to additional suites remain
      part of the scenario’s proof.
---

# Layout assignments table

## Verification Boundary

This integration suite checks reusable record presentations within the local test harness. The registered file and pinned revision define its boundary.

## What This Suite Proves

The bindings identify the detailed or feature scenarios whose outcomes have assertions in this suite. Original case references remain attached to the detailed scenarios so a reviewer can inspect the exact assertion. Assertions are evidence of implemented checks; no execution result is claimed.

## What It Does Not Prove

The register does not establish a current passing run or full specification conformance. Behavior outside the suite’s fixtures and assertions remains unverified.

## Real Dependencies and Test Doubles

The fixture uses PostgreSQL and the imported persistence or API code. The fixture imports identify the setup seams; this register makes no broader claim that dependencies are undoubled.

## Must Not Be Doubled

The operation under examination and its asserted stored outcomes must remain real within the declared harness. A fixture cannot replace the write, refusal or transactional effect that the bound scenario checks.
