Conform more code to strict null checking (#10153)

* Conform more code to strict null checking

* Conform more code to strict null checking

* Iterate

* Iterate
This commit is contained in:
Michael Telatynski 2023-02-15 13:36:22 +00:00 committed by GitHub
parent a4ff959aa1
commit 145a5a8a8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
89 changed files with 520 additions and 551 deletions

View file

@ -61,7 +61,7 @@ describe("<StyledRadioGroup />", () => {
value: optionC.value,
});
expect(getCheckedInput(component).value).toEqual(optionC.value);
expect(getCheckedInput(component)?.value).toEqual(optionC.value);
});
it("selects correct buttons when definitions have checked prop", () => {
@ -99,7 +99,7 @@ describe("<StyledRadioGroup />", () => {
onChange,
});
fireEvent.click(getInputByValue(component, optionB.value));
fireEvent.click(getInputByValue(component, optionB.value)!);
expect(onChange).toHaveBeenCalledWith(optionB.value);
});

View file

@ -62,7 +62,7 @@ describe("<TooltipTarget />", () => {
const alignmentKeys = Object.keys(Alignment).filter((o: any) => isNaN(o));
it.each(alignmentKeys)("displays %s aligned tooltip on mouseover", async (alignment: any) => {
const wrapper = getComponent({ alignment: Alignment[alignment] });
const wrapper = getComponent({ alignment: Alignment[alignment] })!;
act(() => {
Simulate.mouseOver(wrapper);
});
@ -70,7 +70,7 @@ describe("<TooltipTarget />", () => {
});
it("hides tooltip on mouseleave", () => {
const wrapper = getComponent();
const wrapper = getComponent()!;
act(() => {
Simulate.mouseOver(wrapper);
});
@ -82,7 +82,7 @@ describe("<TooltipTarget />", () => {
});
it("displays tooltip on focus", () => {
const wrapper = getComponent();
const wrapper = getComponent()!;
act(() => {
Simulate.focus(wrapper);
});
@ -90,7 +90,7 @@ describe("<TooltipTarget />", () => {
});
it("hides tooltip on blur", async () => {
const wrapper = getComponent();
const wrapper = getComponent()!;
act(() => {
Simulate.focus(wrapper);
});