Skip to content

Commit

Permalink
fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliidm committed Nov 29, 2021
1 parent e6e75ff commit ce86fdf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
RULE_SWITCH,
SHOWING_RULES_TEXT,
RULES_MONIROTING_TABLE,
SELECT_ALL_RULES_ON_PAFE_CHECKBOX,
SELECT_ALL_RULES_ON_PAGE_CHECKBOX,
} from '../../screens/alerts_detection_rules';

import { goToManageAlertsDetectionRules, waitForAlertsIndexToBeCreated } from '../../tasks/alerts';
Expand Down Expand Up @@ -96,9 +96,9 @@ describe('Actions with prebuilt rules', () => {
cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'false');
});

it('Allows to activate all rules on a page and deactivate one at monitoring table', () => {
it('Allows to activate all rules on a page and deactivate single one at monitoring table', () => {
cy.get(RULES_MONIROTING_TABLE).click();
cy.get(SELECT_ALL_RULES_ON_PAFE_CHECKBOX).click();
cy.get(SELECT_ALL_RULES_ON_PAGE_CHECKBOX).click();
activateSelectedRules();
waitForRuleToChangeStatus();
cy.get(RULE_SWITCH).should('have.attr', 'aria-checked', 'true');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ export const ALERT_DETAILS_CELLS = '[data-test-subj="dataGridRowCell"]';

export const SERVER_SIDE_EVENT_COUNT = '[data-test-subj="server-side-event-count"]';

export const SELECT_ALL_RULES_ON_PAFE_CHECKBOX = '[data-test-subj="checkboxSelectAll"]';
export const SELECT_ALL_RULES_ON_PAGE_CHECKBOX = '[data-test-subj="checkboxSelectAll"]';
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ export const RulesTables = React.memo<RulesTableProps>(
}, selectedRuleIds);

const euiBasicTableSelectionProps = useMemo(
<T extends TableItem>() => ({
selectable: (item: T) => !loadingRuleIds.includes(item.id),
onSelectionChange: (selected: T[]) => {
() => ({
selectable: (item: TableItem) => !loadingRuleIds.includes(item.id),
onSelectionChange: (selected: TableItem[]) => {
/**
* EuiBasicTable doesn't provide declarative API to control selected rows.
* This limitation requires us to synchronize selection state manually using setSelection().
Expand Down Expand Up @@ -444,8 +444,6 @@ export const RulesTables = React.memo<RulesTableProps>(
[initLoading, prePackagedRuleStatus, rulesCustomInstalled]
);

// update rules statuses with rules to avoid having stale rule object in ruleStatus
// happens because ruleStatuses retrieved asyncronously from _find_statuses API
const items = useMemo(() => {
const rulesMap = new Map(rules.map((item) => [item.id, item]));

Expand Down

0 comments on commit ce86fdf

Please sign in to comment.