Skip to content

Commit

Permalink
[Security Solution][Investigations] Fixes notes tab test in MKI (#1…
Browse files Browse the repository at this point in the history
…79059)

## Summary

The tests that were using the `author` in assertions for the notes tab
tests in timeline, are failing in MKI

This is because we are hardcoding the username as
`system_indices_superuser`, but that one, does not exist on MKI
projects.

In this PR we are fixing the issue.

---------

Co-authored-by: Michael Olorunnisola <[email protected]>
  • Loading branch information
MadameSheema and michaelolo24 authored Mar 20, 2024
1 parent 9b403f1 commit ee238c3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { addNotesToTimeline, goToNotesTab } from '../../../tasks/timeline';

import { deleteTimelines } from '../../../tasks/api_calls/common';

const text = 'system_indices_superuser';
const author = Cypress.env('ELASTICSEARCH_USERNAME');
const link = 'https://www.elastic.co/';

describe('Timeline notes tab', { tags: ['@ess', '@serverless'] }, () => {
Expand Down Expand Up @@ -69,12 +69,12 @@ describe('Timeline notes tab', { tags: ['@ess', '@serverless'] }, () => {

it('should render the right author', () => {
addNotesToTimeline(getTimelineNonValidQuery().notes);
cy.get(NOTES_AUTHOR).first().should('have.text', text);
cy.get(NOTES_AUTHOR).first().should('have.text', author);
});

it('should be able to render a link', () => {
addNotesToTimeline(`[${text}](${link})`);
cy.get(NOTES_LINK).last().should('have.text', `${text}(opens in a new tab or window)`);
addNotesToTimeline(`[${author}](${link})`);
cy.get(NOTES_LINK).last().should('have.text', `${author}(opens in a new tab or window)`);
cy.get(NOTES_LINK).last().click();
});

Expand Down

0 comments on commit ee238c3

Please sign in to comment.