Add ESLint Jest (#10261)

This commit is contained in:
Michael Weimann 2023-03-01 16:23:35 +01:00 committed by GitHub
parent db7748b743
commit 5398db21ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 336 additions and 351 deletions

View file

@ -79,7 +79,7 @@ describe("InteractiveAuthDialog", function () {
await flushPromises();
expect(makeRequest).toHaveBeenCalledTimes(1);
expect(makeRequest).toBeCalledWith(
expect(makeRequest).toHaveBeenCalledWith(
expect.objectContaining({
session: "sess",
type: "m.login.password",
@ -91,7 +91,7 @@ describe("InteractiveAuthDialog", function () {
}),
);
expect(onFinished).toBeCalledTimes(1);
expect(onFinished).toBeCalledWith(true, { a: 1 });
expect(onFinished).toHaveBeenCalledTimes(1);
expect(onFinished).toHaveBeenCalledWith(true, { a: 1 });
});
});

View file

@ -69,7 +69,7 @@ describe("<MessageEditHistory />", () => {
expect(container).toMatchSnapshot();
});
it("should support events with ", async () => {
it("should support events with", async () => {
mockEdits(
{ msg: "My Great Massage", ts: undefined },
{ msg: "My Great Massage?", ts: undefined },

View file

@ -112,7 +112,7 @@ exports[`<MessageEditHistory /> should match the snapshot 1`] = `
</div>
`;
exports[`<MessageEditHistory /> should support events with 1`] = `
exports[`<MessageEditHistory /> should support events with 1`] = `
<div>
<div
data-focus-guard="true"

View file

@ -431,30 +431,5 @@ describe("<PollHistoryDialog />", () => {
`https://matrix.to/#/!room:domain.org/${pollEnd3.getId()!}`,
);
});
it("navigates back to poll list from detail view on header click", async () => {
await setupRoomWithPollEvents([pollStart1, pollStart2, pollStart3], [], [pollEnd3], mockClient, room);
const { getByText, queryByText, getByTestId, container } = getComponent();
await flushPromises();
fireEvent.click(getByText("Question?"));
// detail view
expect(getByText("Question?")).toBeInTheDocument();
// header not shown
expect(queryByText("Polls history")).not.toBeInTheDocument();
expect(getByText("Active polls")).toMatchSnapshot();
fireEvent.click(getByText("Active polls"));
// main list header displayed again
expect(getByText("Polls history")).toBeInTheDocument();
// active filter still active
expect(getByTestId("filter-tab-PollHistoryDialog_filter-ACTIVE").firstElementChild).toBeChecked();
// list displayed
expect(container.getElementsByClassName("mx_PollHistoryList_list").length).toBeTruthy();
});
});
});

View file

@ -29,19 +29,6 @@ exports[`<PollHistoryDialog /> Poll detail navigates back to poll list from deta
</div>
`;
exports[`<PollHistoryDialog /> Poll detail navigates back to poll list from detail view on header click 2`] = `
<div
class="mx_AccessibleButton mx_PollDetailHeader mx_AccessibleButton_hasKind mx_AccessibleButton_kind_content_inline"
role="button"
tabindex="0"
>
<div
class="mx_PollDetailHeader_icon"
/>
Active polls
</div>
`;
exports[`<PollHistoryDialog /> renders a list of active polls when there are polls in the room 1`] = `
<div>
<div