Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
gbere committed Sep 6, 2023
1 parent 9508602 commit 7783245
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/LiveComponent/assets/test/Backend/RequestBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('buildRequest', () => {
expect(fetchOptions.method).toEqual('GET');
expect(fetchOptions.headers).toEqual({
Accept: 'application/vnd.live-component+html',
'X-Requested-With': 'XMLHttpRequest',
});
});

Expand All @@ -38,6 +39,7 @@ describe('buildRequest', () => {
expect(fetchOptions.headers).toEqual({
Accept: 'application/vnd.live-component+html',
'X-CSRF-TOKEN': '_the_csrf_token',
'X-Requested-With': 'XMLHttpRequest',
});
const body = <FormData>fetchOptions.body;
expect(body).toBeInstanceOf(FormData);
Expand Down Expand Up @@ -100,6 +102,7 @@ describe('buildRequest', () => {
expect(fetchOptions.headers).toEqual({
// no token
Accept: 'application/vnd.live-component+html',
'X-Requested-With': 'XMLHttpRequest',
});
const body = <FormData>fetchOptions.body;
expect(body).toBeInstanceOf(FormData);
Expand Down Expand Up @@ -180,6 +183,7 @@ describe('buildRequest', () => {
expect(fetchOptions.headers).toEqual({
Accept: 'application/vnd.live-component+html',
'X-CSRF-TOKEN': '_the_csrf_token',
'X-Requested-With': 'XMLHttpRequest',
});
const body = <FormData>fetchOptions.body;
expect(body).toBeInstanceOf(FormData);
Expand All @@ -204,6 +208,7 @@ describe('buildRequest', () => {
expect(fetchOptions.headers).toEqual({
Accept: 'application/vnd.live-component+html',
'X-CSRF-TOKEN': '_the_csrf_token',
'X-Requested-With': 'XMLHttpRequest',
});
const body = <FormData>fetchOptions.body;
expect(body).toBeInstanceOf(FormData);
Expand Down

0 comments on commit 7783245

Please sign in to comment.