React Browser Tests
  • Home
  • Components
    • Test Container
    • Test
    • Test Group
    • Single Test Container Overview
    • Multiple Test Container Overview
    • Multiple Page Overview
    • Sidebar Layout
  • Helper Functions
  • Run in a Terminal
  • Tests

<MultipleTestContainersOverview>

Note: having multiple <TestContainer> elements in a page is possible, but it will significantly increase complexity, and may not be working 100% correctly.

Shows an overview of all the tests in all <TestContainer> elements in a single page.

Example with 2 <TestContainer>'s in a NextJS page:

import { Test, TestContainer, expect, MultipleTestContainersOverview } from "react-browser-tests";

export default function Page() {
  return (
    <>
      <TestContainer>
        <Test style={{display: "none"}} title="Simple passing test: 1 + 1 = 2" fn={async () => {
          expect(1 + 1).to.equal(2);
        }} />
      </TestContainer >

      <TestContainer id="failing-container">
        <Test style={{display: "none"}} title="Simple failing test: 1 + 1 = 3" fn={async () => {
          expect(1 + 1).to.equal(3);
        }} />
      </TestContainer >

      <MultipleTestContainersOverview />
    </>
  );
}

Note that in the code above, the tests have display: none. This way, only the <MultipleTestContainersOverview> component will be visible. The final result is:

Simple passing test: 1 + 1 = 2
Simple failing test: 1 + 1 = 3

Props

iframeUrl?

String - if the current page has an iframe, and we wish to show an overview for the tests in that iframe, we can pass in the iframe's url here.

showGroupStats?

Boolean - whether or not to show <TestGroup> information. Default is false.

HTMLDivElement props

Supports standard HTMLDivElement props. For example: className, style, etc.