/*
* Copyright 2020 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { useMemo } from "react";
import {
Icons, Stub, Table, Cells, Label, Tooltip, LinkButton,
} from "@drill4j/ui-kit";
import { Link } from "react-router-dom";
import "twin.macro";
import { capitalize } from "@drill4j/common-utils";
import { TestCoverageInfo } from "types/test-coverage-info";
import { useActiveBuild, useAgentRouteParams } from "hooks";
import { transformTests } from "utils";
import { Label as LabelType } from "types";
import { getModalPath, BUILD_STATUS } from "common";
import { ColumnFilterByValues, TestsStatus } from "components";
import { filterByValues } from "components/column-filter-by-values";
interface Props {
tests: TestCoverageInfo[];
topicCoveredMethodsByTest: string;
testTypes: string[]
}
export const TestDetails = ({ tests, testTypes }: Props) => {
const { agentId } = useAgentRouteParams();
const { buildStatus } = useActiveBuild(agentId) || {};
const columns = useMemo(() => getColumns(testTypes), [testTypes]);
const stub = useMemo(() => (tests.length > 0
? (
}
title="No results found"
message="Try adjusting your search or filter to find what you are looking for."
/>
)
: (
}
title={buildStatus === BUILD_STATUS.BUSY ? "Build tests are loading" : "No tests available yet"}
message={buildStatus === BUILD_STATUS.BUSY
? "It may take a few seconds."
: "Information about project tests will appear after the first launch of tests."}
/>
)), [tests.length]);
const transformedTests = useMemo(() => transformTests(tests), [tests]);
return (
(
Application tests
{`Displaying ${currentCount} of ${totalCount} tests`}