Conform more of the codebase to strictNullChecks
(#10350
* Conform more of the codebase to `strictNullChecks` * Iterate * Generics ftw * Iterate
This commit is contained in:
parent
d53e91802d
commit
127a3b667c
53 changed files with 279 additions and 263 deletions
|
@ -18,6 +18,7 @@ import React from "react";
|
|||
import { act, fireEvent, render } from "@testing-library/react";
|
||||
|
||||
import TabbedView, { Tab, TabLocation } from "../../../src/components/structures/TabbedView";
|
||||
import { NonEmptyArray } from "../../../src/@types/common";
|
||||
|
||||
describe("<TabbedView />", () => {
|
||||
const generalTab = new Tab("GENERAL", "General", "general", <div>general</div>);
|
||||
|
@ -25,7 +26,7 @@ describe("<TabbedView />", () => {
|
|||
const securityTab = new Tab("SECURITY", "Security", "security", <div>security</div>);
|
||||
const defaultProps = {
|
||||
tabLocation: TabLocation.LEFT,
|
||||
tabs: [generalTab, labsTab, securityTab],
|
||||
tabs: [generalTab, labsTab, securityTab] as NonEmptyArray<Tab>,
|
||||
};
|
||||
const getComponent = (props = {}): React.ReactElement => <TabbedView {...defaultProps} {...props} />;
|
||||
|
||||
|
@ -58,11 +59,6 @@ describe("<TabbedView />", () => {
|
|||
expect(getActiveTabBody(container)?.textContent).toEqual("security");
|
||||
});
|
||||
|
||||
it("renders without error when there are no tabs", () => {
|
||||
const { container } = render(getComponent({ tabs: [] }));
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("sets active tab on tab click", () => {
|
||||
const { container, getByTestId } = render(getComponent());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue