Skip to content

Commit

Permalink
make it optional not just undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
dhurley14 committed Nov 11, 2020
1 parent d979011 commit e66e3a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x-pack/plugins/security_solution/cypress/tasks/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const loginWithRole = async (role: string) => {
* To speed the execution of tests, prefer this non-interactive authentication,
* which is faster than authentication via Kibana's interactive login page.
*/
export const login = (role: string | undefined) => {
export const login = (role?: string) => {
if (role != null) {
loginWithRole(role);
} else if (credentialsProvidedByEnvironment()) {
Expand Down Expand Up @@ -224,14 +224,14 @@ export const loginAndWaitForPage = (url: string, role: string | undefined) => {
cy.get('[data-test-subj="headerGlobalNav"]');
};

export const loginAndWaitForPageWithoutDateRange = (url: string, role: string | undefined) => {
export const loginAndWaitForPageWithoutDateRange = (url: string, role?: string) => {
login(role);
cy.viewport('macbook-15');
cy.visit(role ? getUrlWithRoute(role, url) : url);
cy.get('[data-test-subj="headerGlobalNav"]', { timeout: 120000 });
};

export const loginAndWaitForTimeline = (timelineId: string, role: string | undefined) => {
export const loginAndWaitForTimeline = (timelineId: string, role?: string) => {
const route = `/app/security/timelines?timeline=(id:'${timelineId}',isOpen:!t)`;

login(role);
Expand Down

0 comments on commit e66e3a8

Please sign in to comment.