Remove feedback buttons from onboarding, search, and spaces (#10506)

This commit is contained in:
Michael Telatynski 2023-04-05 12:17:25 +01:00 committed by GitHub
parent df89d2ce28
commit 09eefe14ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 4 additions and 305 deletions

View file

@ -26,7 +26,6 @@ import { LocalRoom, LOCAL_ROOM_ID_PREFIX } from "../../../../src/models/LocalRoo
import { DirectoryMember, startDmOnFirstMessage } from "../../../../src/utils/direct-messages";
import DMRoomMap from "../../../../src/utils/DMRoomMap";
import { flushPromisesWithFakeTimers, mkRoom, stubClient } from "../../../test-utils";
import { shouldShowFeedback } from "../../../../src/utils/Feedback";
import SettingsStore from "../../../../src/settings/SettingsStore";
import { SettingLevel } from "../../../../src/settings/SettingLevel";
import defaultDispatcher from "../../../../src/dispatcher/dispatcher";
@ -387,28 +386,6 @@ describe("Spotlight Dialog", () => {
);
});
describe("Feedback prompt", () => {
it("should show feedback prompt if feedback is enabled", async () => {
mocked(shouldShowFeedback).mockReturnValue(true);
render(<SpotlightDialog initialText="test23" onFinished={() => null} />);
jest.advanceTimersByTime(200);
await flushPromisesWithFakeTimers();
expect(screen.getByText("give feedback")).toBeInTheDocument();
});
it("should hide feedback prompt if feedback is disabled", async () => {
mocked(shouldShowFeedback).mockReturnValue(false);
render(<SpotlightDialog initialText="test23" onFinished={() => null} />);
jest.advanceTimersByTime(200);
await flushPromisesWithFakeTimers();
expect(screen.queryByText("give feedback")).not.toBeInTheDocument();
});
});
describe("nsfw public rooms filter", () => {
const nsfwNameRoom: IPublicRoomsChunkRoom = {
room_id: "@room1:matrix.org",

View file

@ -14,14 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import React from "react";
import { screen, render } from "@testing-library/react";
import {
getUserOnboardingCounters,
UserOnboardingList,
} from "../../../../src/components/views/user-onboarding/UserOnboardingList";
import SdkConfig from "../../../../src/SdkConfig";
import { getUserOnboardingCounters } from "../../../../src/components/views/user-onboarding/UserOnboardingList";
const tasks = [
{
@ -61,28 +54,3 @@ describe("getUserOnboardingCounters()", () => {
expect(result).toStrictEqual(expectation);
});
});
describe("UserOnboardingList", () => {
// This configuration affects rendering of the feedback and needs to be set.
beforeAll(() => {
SdkConfig.put({
bug_report_endpoint_url: "https://bug_report_endpoint_url.com",
});
});
it("should not display feedback when there are waiting tasks", async () => {
render(<UserOnboardingList tasks={tasks} />);
expect(await screen.findByText("Only 1 step to go")).toBeVisible();
expect(await screen.queryByTestId("user-onboarding-feedback")).toBeNull();
expect(await screen.findAllByTestId("user-onboarding-task")).toHaveLength(2);
});
it("should display feedback when all tasks are completed", async () => {
render(<UserOnboardingList tasks={tasks.map((task) => ({ ...task, completed: true }))} />);
expect(await screen.findByText("You did it!")).toBeVisible();
expect(await screen.findByTestId("user-onboarding-feedback")).toBeInTheDocument();
expect(await screen.queryAllByTestId("user-onboarding-task")).toHaveLength(2);
});
});