Skip to content

Commit

Permalink
Fix issue with headers not being extendable when attempting to use `r…
Browse files Browse the repository at this point in the history
…equest()` with Form data
  • Loading branch information
paul-tavares committed Jul 28, 2023
1 parent eb7d467 commit 1df3a37
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -10,7 +10,7 @@ export const API_AUTH = Object.freeze({
pass: Cypress.env('KIBANA_PASSWORD') ?? Cypress.env('ELASTICSEARCH_PASSWORD'),
});

export const COMMON_API_HEADERS = { 'kbn-xsrf': 'cypress' };
export const COMMON_API_HEADERS = Object.freeze({ 'kbn-xsrf': 'cypress' });

export const waitForPageToBeLoaded = () => {
cy.getByTestSubj('globalLoadingIndicator-hidden').should('exist');
Expand All @@ -28,6 +28,6 @@ export const request = <T = unknown>({
}: Partial<Cypress.RequestOptions>): Cypress.Chainable<Cypress.Response<T>> =>
cy.request<T>({
auth: API_AUTH,
headers: Object.freeze({ ...COMMON_API_HEADERS, ...headers }),
headers: { ...COMMON_API_HEADERS, ...headers },
...options,
});

0 comments on commit 1df3a37

Please sign in to comment.