Polish & delabs Exploring public spaces feature (#11423)

* Iterate search public spaces UX

* Tweak iconography in spotlight

* Delabs `Exploring public spaces`

* Tweak msc3827 v1.4 support discovery

* i18n

* Delete stale test

* Fix tests

* Iterate

* Iterate PR based on review

* Improve types

* Add shortcut to search for public spaces to create space menu

* Update import

* Add org.matrix.msc3827.stable filtering

* Fix tests

* silence some errors
This commit is contained in:
Michael Telatynski 2023-08-21 10:39:20 +01:00 committed by GitHub
parent d81f71f993
commit dd6097c568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 180 additions and 107 deletions

View file

@ -71,7 +71,7 @@ describe("<LabsUserSettingsTab />", () => {
// non-beta labs section
expect(screen.getByText("Early previews")).toBeInTheDocument();
const labsSections = container.getElementsByClassName("mx_SettingsSubsection");
expect(labsSections).toHaveLength(10);
expect(labsSections).toHaveLength(9);
});
it("allow setting a labs flag which requires unstable support once support is confirmed", async () => {
@ -80,21 +80,21 @@ describe("<LabsUserSettingsTab />", () => {
const deferred = defer<boolean>();
cli.doesServerSupportUnstableFeature.mockImplementation(async (featureName) => {
return featureName === "org.matrix.msc3827.stable" ? deferred.promise : false;
return featureName === "org.matrix.msc3952_intentional_mentions" ? deferred.promise : false;
});
MatrixClientBackedController.matrixClient = cli;
const { queryByText } = render(getComponent());
expect(
queryByText("Explore public spaces in the new search dialog")!
queryByText("Enable intentional mentions")!
.closest(".mx_SettingsFlag")!
.querySelector(".mx_AccessibleButton"),
).toHaveAttribute("aria-disabled", "true");
deferred.resolve(true);
await waitFor(() => {
expect(
queryByText("Explore public spaces in the new search dialog")!
queryByText("Enable intentional mentions")!
.closest(".mx_SettingsFlag")!
.querySelector(".mx_AccessibleButton"),
).toHaveAttribute("aria-disabled", "false");