Skip to content

Commit

Permalink
Use flashSuccessToast when deleting a domain (#107948)
Browse files Browse the repository at this point in the history
  • Loading branch information
byronhulcher committed Aug 10, 2021
1 parent 32ebd0a commit 6883c52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const MOCK_CLIENT_CRAWLER_DATA = crawlerDataServerToClient(MOCK_SERVER_CRAWLER_D
describe('CrawlerOverviewLogic', () => {
const { mount, unmount } = new LogicMounter(CrawlerOverviewLogic);
const { http } = mockHttpValues;
const { flashAPIErrors, setSuccessMessage } = mockFlashMessageHelpers;
const { flashAPIErrors, flashSuccessToast } = mockFlashMessageHelpers;

beforeEach(() => {
jest.clearAllMocks();
Expand Down Expand Up @@ -192,7 +192,7 @@ describe('CrawlerOverviewLogic', () => {
expect(CrawlerOverviewLogic.actions.onReceiveCrawlerData).toHaveBeenCalledWith(
MOCK_CLIENT_CRAWLER_DATA
);
expect(setSuccessMessage).toHaveBeenCalled();
expect(flashSuccessToast).toHaveBeenCalled();
});

it('calls flashApiErrors when there is an error', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { kea, MakeLogicType } from 'kea';

import { flashAPIErrors, setSuccessMessage } from '../../../shared/flash_messages';
import { flashAPIErrors, flashSuccessToast } from '../../../shared/flash_messages';

import { HttpLogic } from '../../../shared/http';
import { EngineLogic } from '../engine';
Expand Down Expand Up @@ -136,7 +136,7 @@ export const CrawlerOverviewLogic = kea<
);
const crawlerData = crawlerDataServerToClient(response);
actions.onReceiveCrawlerData(crawlerData);
setSuccessMessage(getDeleteDomainSuccessMessage(domain.url));
flashSuccessToast(getDeleteDomainSuccessMessage(domain.url));
} catch (e) {
flashAPIErrors(e);
}
Expand Down

0 comments on commit 6883c52

Please sign in to comment.