Public Access
feat(settings): remove the platform mails switch
Broadcasts go to every active user, so the settings switch and its API call are gone. Admin broadcast texts no longer mention an opt-out.
This commit is contained in:
1 parent
6dda186bdf
commit
80259cb0e9
8 files changed
+19
-60
No files matched your search
@@ -31,7 +31,6 @@ const authRoutes = (me) => ({
|
||||
'PUT /api/users/settings/appearance': noBody,
|
||||
'PUT /api/users/settings/profile-style': noBody,
|
||||
'PUT /api/users/settings/favorite-platform': noBody,
|
||||
'PUT /api/users/settings/platform-mails': noBody,
|
||||
'GET /api/version': json(404, {}),
|
||||
});
|
||||
|
||||
@@ -257,29 +256,6 @@ describe('SettingsPage favorite platform', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('SettingsPage platform mails', () => {
|
||||
beforeEach(() => localStorage.setItem('tbp_session', '1'));
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
it('is on by default and saves the opt-out', async () => {
|
||||
toast.success.mockClear();
|
||||
renderPage(profile());
|
||||
|
||||
const mails = await screen.findByRole('switch', {name: 'SETTINGS.PLATFORM_MAILS'});
|
||||
expect(mails.getAttribute('aria-checked')).toBe('true');
|
||||
fireEvent.click(mails);
|
||||
|
||||
await waitFor(() => expect(puts()).toEqual([{enabled: false}]));
|
||||
expect(fetch.mock.calls.find(([, init]) => init?.method === 'PUT')[0]).toContain('/api/users/settings/platform-mails');
|
||||
await waitFor(() => expect(toast.success).toHaveBeenCalledWith('SETTINGS.SAVED'));
|
||||
expect(mails.getAttribute('aria-checked')).toBe('false');
|
||||
});
|
||||
});
|
||||
|
||||
describe('SettingsPage session', () => {
|
||||
beforeEach(() => localStorage.setItem('tbp_session', '1'));
|
||||
|
||||
|
||||
Reference in new issue
Block a user