|
|
|
@ -6,7 +6,7 @@ import { __stub } from 'soapbox/api';
|
|
|
|
|
import { normalizeAccount } from 'soapbox/normalizers';
|
|
|
|
|
import { ReducerAccount } from 'soapbox/reducers/accounts';
|
|
|
|
|
|
|
|
|
|
import { render, screen } from '../../../../../jest/test-helpers';
|
|
|
|
|
import { render, screen, waitFor } from '../../../../../jest/test-helpers';
|
|
|
|
|
import ChatPage from '../chat-page';
|
|
|
|
|
|
|
|
|
|
describe('<ChatPage />', () => {
|
|
|
|
@ -48,9 +48,12 @@ describe('<ChatPage />', () => {
|
|
|
|
|
await userEvent.click(screen.getByTestId('button'));
|
|
|
|
|
|
|
|
|
|
expect(screen.getByTestId('chat-page')).toBeInTheDocument();
|
|
|
|
|
|
|
|
|
|
await waitFor(() => {
|
|
|
|
|
expect(screen.getByTestId('toast')).toHaveTextContent('Chat Settings updated successfully');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
describe('when the API returns an error', () => {
|
|
|
|
|
beforeEach(() => {
|
|
|
|
@ -77,8 +80,11 @@ describe('<ChatPage />', () => {
|
|
|
|
|
it('renders the Chats', async () => {
|
|
|
|
|
render(<ChatPage />, undefined, store);
|
|
|
|
|
await userEvent.click(screen.getByTestId('button'));
|
|
|
|
|
|
|
|
|
|
await waitFor(() => {
|
|
|
|
|
expect(screen.getByTestId('toast')).toHaveTextContent('Chat Settings failed to update.');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|