flexpect - v0.21.0
    Preparing search index...
    • Asserts that the target element fits entirely within the bounds of the specified container element. The check ensures that all sides of the target element (top, bottom, left, right) are strictly within the bounds of the container, with no partial overlap allowed.

      • Perfect Fit (Pass):
      ┌─────────────────────┐
      │┌───────────────────┐│
      ││                   ││
      ││      Element      ││
      ││   (Perfect Fit)   ││
      ││                   ││
      │└───────────────────┘│
      └─────────────────────┘
      
      • Position Mismatch (Fail):
      ┌──────────────────────┐
      │                      │
      │ ┌──────────────────┐ │
      │ │     Element      │ │
      │ │ (Wrong Position) │ │
      │ └──────────────────┘ │
      └──────────────────────┘
      
      • Size Mismatch (Fail):
      ┌─────────────────────┐
      │   ┌─────────────┐   │
      │   │   Element   │   │
      │   │ (Too Small) │   │
      │   └─────────────┘   │
      └─────────────────────┘
      
      • Overflow (Fail):
      ┌─────────────────────┐
      │┌────────────────────┼─┐
      ││       Element      │ │
      ││      (Overflow)    │ │
      │└────────────────────┼─┘
      └─────────────────────┘
      

      Parameters

      • element: Locator

        The element as a Locator to check for fitting within the container.

      • container: Locator

        The container element as a Locator within which the element is expected to fit.

      Returns Promise<MatcherReturnType>

      A Promise that resolves with the matcher result.

      await expect(locator).toFitContainer(parentLocator);