Skip to content

BoxLang: bulkOperationsSpec type assertions reject BoxLang-classed model instances #2662

Description

@bpamiri

Describe the bug

wheels.tests.specs.model.bulkOperationsSpec asserts that the values returned from insertAll() / updateAll() / friends are of type "component". On BoxLang the assertion fails with:

The actual is of type [wheels.tests._assets.models.BulkItem] which is not the expected type of [component]

BoxLang reports the FQN of the class, not the generic component type that Lucee/Adobe use.

Evidence

Compat-matrix run #25837380625 (2026-05-13).

  • 8 occurrences on BoxLang across cockroachdb, mysql, postgres, sqlite.
  • Plus a sibling cluster of 4 occurrences with [wheels.tests._assets.models.Author] instead of BulkItem — same root cause.
  • Lucee/Adobe pass cleanly.
  • Affected suites (all in bulkOperationsSpec): insertAll, updateAll, related — wherever expect(record).toBeTypeOf("component") appears.

To Reproduce

  1. Hit /wheels/core/tests?db=sqlite&format=json&directory=tests.specs.model.bulkOperationsSpec on BoxLang.
  2. Any spec containing toBeTypeOf("component") (or equivalent) on a model instance errors with the message above.

Expected behavior

The assertion should accept any Wheels model instance as "a Wheels component" regardless of how the underlying engine reflects the class metadata.

Root cause

CFML engines differ on how getMetadata(obj).type / WheelsTest's toBeTypeOf resolve class identity:

  • Lucee / Adobe → returns "component" for any CFC instance.
  • BoxLang → returns the fully-qualified class name (e.g. wheels.tests._assets.models.BulkItem).

The spec is using the wrong assertion shape for cross-engine work. There's no portable way to assert "this is a CFC" via the literal "component" string.

Suggested fix shape

Replace toBeTypeOf("component") with one of:

  1. toBeInstanceOf("Model") — most semantically correct; checks against the Wheels Model base class.
  2. expect(IsObject(record)).toBeTrue() — most permissive; just confirms it's an object.
  3. expect(IsInstanceOf(record, "Model")).toBeTrue() — alternative shape.

Pure test edit — no framework changes. Estimated <10 minutes for one experienced contributor.

Additional context

Related: #2649

Metadata

Metadata

Assignees

No one assigned

    Labels

    boxlangBoxLang-specific compatibility issue; tracked but may not gate Lucee/Adobe releasesbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions