diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx
index f17c73e5e15..418657dd867 100644
--- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx
+++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx
@@ -527,7 +527,8 @@ export default class GeneralUserSettingsTab extends React.Component", () => {
expect(screen.queryByText("Deactivate account")).not.toBeInTheDocument();
expect(SettingsStore.getValue).toHaveBeenCalledWith(UIFeature.Deactivate);
});
+ it("should not render section when account is managed externally", async () => {
+ jest.spyOn(SettingsStore, "getValue").mockImplementation(
+ (settingName) => settingName === UIFeature.Deactivate,
+ );
+ // account is managed externally when we have delegated auth configured
+ mockClient.getClientWellKnown.mockReturnValue({
+ [M_AUTHENTICATION.name]: {
+ issuer: "https://issuer.org",
+ account: "https://issuer.org/account",
+ },
+ });
+ render(getComponent());
+
+ await flushPromises();
+
+ expect(screen.queryByText("Deactivate account")).not.toBeInTheDocument();
+ });
it("should render section when account deactivation feature is enabled", () => {
jest.spyOn(SettingsStore, "getValue").mockImplementation(
(settingName) => settingName === UIFeature.Deactivate,
diff --git a/test/components/views/settings/tabs/user/__snapshots__/GeneralUserSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/user/__snapshots__/GeneralUserSettingsTab-test.tsx.snap
index e2f20a35a75..a2e13ed8434 100644
--- a/test/components/views/settings/tabs/user/__snapshots__/GeneralUserSettingsTab-test.tsx.snap
+++ b/test/components/views/settings/tabs/user/__snapshots__/GeneralUserSettingsTab-test.tsx.snap
@@ -42,14 +42,14 @@ exports[` 3pids should display 3pid email addresses an
>
@@ -150,14 +150,14 @@ exports[` 3pids should display 3pid email addresses an