All files / pages ArtifactSelectionPage.jsx

100% Statements 32/32
100% Branches 1/1
100% Functions 1/1
100% Lines 32/32

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 421x 1x 1x 1x 1x   1x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x   4x 4x 4x 4x 4x 4x 4x   4x   4x 4x 4x 4x   4x         4x  
import React from "react";
import BasicLayout from "main/layouts/BasicLayout/BasicLayout";
import { Tab, Tabs } from "react-bootstrap";
import RepositorySelectionForm from "main/components/RepositorySelectionForm";
import { useBackend } from "main/utils/useBackend";
 
export default function ArtifactSelectionPage() {
  // /api/collections/list does NOT exist yet. mvp for wireframes.
  const {
    data: collections,
    error: _error,
    status: _status,
  } = useBackend(
    // Stryker disable next-line all : don't test internal caching of React Query
    ["/api/collections/list"],
    // Stryker disable next-line StringLiteral : The default value for an empty ("") method is GET. Therefore, there is no way to kill a mutation that transforms "GET" to ""
    { method: "GET", url: "/api/collections/list" },
    // Stryker disable next-line all : don't test default value of empty list
    [],
  );
  return (
    <BasicLayout>
      <Tabs defaultActiveKey={"select_repos"}>
        <Tab
          eventKey={"select_repos"}
          title={"Select Repositories"}
          className="pt-2"
        >
          <RepositorySelectionForm collections={collections} />
        </Tab>
        <Tab
          eventKey={"select_artifacts"}
          title={"Select Artifacts"}
          className="pt-2"
        >
          <h1>Coming Soon</h1>
        </Tab>
      </Tabs>
    </BasicLayout>
  );
}