1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-30 02:21:17 +03:00

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
15 changed files with 4 additions and 305 deletions

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);
});
});