Skip to content

Commit

Permalink
change session id format and fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
aliraza556 committed Dec 30, 2024
1 parent a4e2119 commit af11fa0
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 94 deletions.
14 changes: 11 additions & 3 deletions src/bounties/__tests__/bountyTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Bounty Tests', () => {
headers: {
'Content-Type': 'application/json',
'x-jwt': undefined,
session_id: sessionId
'x-session-id': sessionId
},
method: 'POST',
mode: 'cors'
Expand Down Expand Up @@ -92,7 +92,11 @@ describe('Bounty Tests', () => {
'http://localhost:5002/gobounties?token=undefined',
{
body: JSON.stringify(newBounty),
headers: { 'Content-Type': 'application/json', 'x-jwt': undefined, session_id: sessionId },
headers: {
'Content-Type': 'application/json',
'x-jwt': undefined,
'x-session-id': sessionId
},
method: 'POST',
mode: 'cors'
}
Expand All @@ -116,7 +120,11 @@ describe('Bounty Tests', () => {
'http://localhost:5002/gobounties?token=undefined',
{
body: JSON.stringify(newBounty),
headers: { 'Content-Type': 'application/json', 'x-jwt': undefined, session_id: sessionId },
headers: {
'Content-Type': 'application/json',
'x-jwt': undefined,
'x-session-id': sessionId
},
method: 'POST',
mode: 'cors'
}
Expand Down
12 changes: 6 additions & 6 deletions src/store/__test__/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ describe('Main store', () => {
headers: {
'x-jwt': user.tribe_jwt,
'Content-Type': 'application/json',
session_id: store.sessionId
'x-session-id': store.sessionId
}
};

Expand Down Expand Up @@ -605,7 +605,7 @@ describe('Main store', () => {
headers: {
'x-jwt': user.tribe_jwt,
'Content-Type': 'application/json',
session_id: store.sessionId
'x-session-id': store.sessionId
}
};
fetchStub.withArgs(url, expectedRequestOptions).throwsException();
Expand All @@ -632,7 +632,7 @@ describe('Main store', () => {
headers: {
'x-jwt': user.tribe_jwt,
'Content-Type': 'application/json',
session_id: store.sessionId
'x-session-id': store.sessionId
}
};
fetchStub.withArgs(url, expectedRequestOptions).returns(
Expand Down Expand Up @@ -663,7 +663,7 @@ describe('Main store', () => {
headers: {
'x-jwt': user.tribe_jwt,
'Content-Type': 'application/json',
session_id: store.sessionId
'x-session-id': store.sessionId
}
};
fetchStub.withArgs(url, expectedRequestOptions).throwsException();
Expand All @@ -686,7 +686,7 @@ describe('Main store', () => {
headers: {
'x-jwt': user.tribe_jwt,
'Content-Type': 'application/json',
session_id: store.sessionId
'x-session-id': store.sessionId
}
};
fetchStub.withArgs(url, expectedRequestOptions).returns(
Expand All @@ -713,7 +713,7 @@ describe('Main store', () => {
headers: {
'x-jwt': user.tribe_jwt,
'Content-Type': 'application/json',
session_id: store.sessionId
'x-session-id': store.sessionId
}
};
fetchStub.withArgs(url, expectedRequestOptions).throwsException();
Expand Down
Loading

0 comments on commit af11fa0

Please sign in to comment.