Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaweiWu committed May 20, 2022
1 parent 17efc94 commit 0a12470
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type ExperimentalFeatures = typeof allowedExperimentalValues;
export const allowedExperimentalValues = Object.freeze({
rulesListDatagrid: true,
internalAlertsTable: false,
internalShareableComponentsSandbox: true,
internalShareableComponentsSandbox: false,
ruleTagFilter: true,
ruleStatusFilter: true,
rulesDetailLogs: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ describe('Update Api Key', () => {
fireEvent.click(screen.getByText('Update'));
});
expect(updateAPIKey).toHaveBeenCalledWith(expect.objectContaining({ id: '2' }));
expect(loadRules).toHaveBeenCalledTimes(2);
expect(loadRules).toHaveBeenCalledTimes(3);
expect(screen.queryByText("You can't recover the old API key")).not.toBeInTheDocument();
expect(addSuccess).toHaveBeenCalledWith('API key has been updated');
});
Expand All @@ -390,7 +390,7 @@ describe('Update Api Key', () => {
fireEvent.click(screen.getByText('Update'));
});
expect(updateAPIKey).toHaveBeenCalledWith(expect.objectContaining({ id: '2' }));
expect(loadRules).toHaveBeenCalledTimes(2);
expect(loadRules).toHaveBeenCalledTimes(3);
expect(
screen.queryByText('You will not be able to recover the old API key')
).not.toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const RulesList: React.FunctionComponent = () => {
} = useKibana().services;
const canExecuteActions = hasExecuteActionsCapability(capabilities);

const [config, setConfig] = useState<TriggersActionsUiConfig>({});
const [config, setConfig] = useState<TriggersActionsUiConfig>({ isUsingSecurity: false });
const [actionTypes, setActionTypes] = useState<ActionType[]>([]);
const [selectedIds, setSelectedIds] = useState<string[]>([]);
const [isPerformingAction, setIsPerformingAction] = useState<boolean>(false);
Expand Down Expand Up @@ -776,7 +776,7 @@ export const RulesList: React.FunctionComponent = () => {
}}
onUpdated={async () => {
setRulesToUpdateAPIKey([]);
await loadRulesData();
await loadData();
}}
/>
<EuiSpacer size="xs" />
Expand Down

0 comments on commit 0a12470

Please sign in to comment.