Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
e40pud committed Feb 23, 2024
1 parent a9f8b2f commit 093e8bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,19 @@ describe('Alert user assignment - ESS & Serverless', { tags: ['@ess', '@serverle
});

context('Basic rendering', () => {
it('alert with no assignees in alerts table', () => {
it('alert with no assignees in alerts table & details flyout', () => {
checkEmptyAssigneesStateInAlertsTable();
});

it(`alert with no assignees in alert's details flyout`, () => {
expandFirstAlert();
checkEmptyAssigneesStateInAlertDetailsFlyout();
});

it('alert with some assignees in alerts table', () => {
it('alert with some assignees in alerts table & details flyout', () => {
const users = [getDefaultUserName()];
updateAssigneesForFirstAlert(users);

alertsTableShowsAssigneesForAlert(users);
});

it(`alert with some assignees in alert's details flyout`, () => {
const users = [getDefaultUserName()];
updateAssigneesForFirstAlert(users);
expandFirstAlert();
alertDetailsFlyoutShowsAssignees(users);
});
Expand Down Expand Up @@ -124,56 +119,6 @@ describe('Alert user assignment - ESS & Serverless', { tags: ['@ess', '@serverle
alertsTableShowsAssigneesForAlert(users);
});

it('updating assignees via `More actions` in alerts table', () => {
// Initially assigned users
const initialAssignees = [getDefaultUserName()];
updateAssigneesForFirstAlert(initialAssignees);
alertsTableShowsAssigneesForAlert(initialAssignees);

// Update assignees
const updatedAssignees = [getDefaultUserName()];
updateAssigneesForFirstAlert(updatedAssignees);

// There should be no assigned alerts
checkEmptyAssigneesStateInAlertsTable();
});

it('updating assignees via add button in flyout', () => {
expandFirstAlert();

// Initially assigned users
const initialAssignees = [getDefaultUserName()];
updateAssigneesViaAddButtonInFlyout(initialAssignees);
alertDetailsFlyoutShowsAssignees(initialAssignees);

// Update assignees
const updatedAssignees = [getDefaultUserName()];
updateAssigneesViaAddButtonInFlyout(updatedAssignees);

// There should be no assigned alerts
checkEmptyAssigneesStateInAlertDetailsFlyout();
closeAlertFlyout();
checkEmptyAssigneesStateInAlertsTable();
});

it('updating assignees via `Take action` button in flyout', () => {
expandFirstAlert();

// Initially assigned users
const initialAssignees = [getDefaultUserName()];
updateAssigneesViaTakeActionButtonInFlyout(initialAssignees);
alertDetailsFlyoutShowsAssignees(initialAssignees);

// Update assignees
const updatedAssignees = [getDefaultUserName()];
updateAssigneesViaTakeActionButtonInFlyout(updatedAssignees);

// There should be no assigned alerts
checkEmptyAssigneesStateInAlertDetailsFlyout();
closeAlertFlyout();
checkEmptyAssigneesStateInAlertsTable();
});

it('removing all assignees via `More actions` in alerts table', () => {
// Initially assigned users
const initialAssignees = [getDefaultUserName()];
Expand Down Expand Up @@ -217,23 +162,6 @@ describe('Alert user assignment - ESS & Serverless', { tags: ['@ess', '@serverle
alertsTableShowsAssigneesForAllAlerts(users);
});

it('updating assignees should be reflected in UI (alerts table)', () => {
selectFirstPageAlerts();

// Initially assigned users
const initialAssignees = [getDefaultUserName()];
bulkUpdateAssignees(initialAssignees);
alertsTableShowsAssigneesForAllAlerts(initialAssignees);

// Update assignees
selectFirstPageAlerts();
const updatedAssignees = [getDefaultUserName()];
bulkUpdateAssignees(updatedAssignees);

// There should be no assigned alerts
checkEmptyAssigneesStateInAlertsTable();
});

it('removing all assignees should be reflected in UI (alerts table)', () => {
selectFirstPageAlerts();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,12 @@ describe(
});

context('Basic rendering', () => {
it('alert with some assignees in alerts table', () => {
it('alert with some assignees in alerts table & details flyout', () => {
const users = [ROLES.detections_admin, ROLES.t1_analyst];
updateAssigneesForFirstAlert(users);

alertsTableShowsAssigneesForAlert(users);
});

it(`alert with some assignees in alert's details flyout`, () => {
const users = [ROLES.detections_admin, ROLES.t1_analyst];
updateAssigneesForFirstAlert(users);
expandFirstAlert();
alertDetailsFlyoutShowsAssignees(users);
});
Expand Down

0 comments on commit 093e8bb

Please sign in to comment.