Skip to content

Commit

Permalink
test: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-moncel committed Nov 26, 2024
1 parent c1cff3e commit 61761aa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/agent/test/utils/query-string.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,26 @@ describe('QueryStringParser', () => {
expect(fn).toThrow(new Error('Time zones are not available in this environment'));
});
});

test('should return the project and environment name', () => {
const context = createMockContext({
state: { user: { email: '[email protected]' } },
customProperties: { query: { timezone: 'America/Los_Angeles' } },
headers: {
'forest-context-url':
'https://app.development.forestadmin.com/new-agent/Development/Operations/data/card/index',
},
});

expect(QueryStringParser.parseCaller(context)).toEqual({
email: '[email protected]',
requestId: expect.any(String),
request: { ip: expect.any(String) },
timezone: 'America/Los_Angeles',
project: 'new-agent',
environment: 'Development',
});
});
});

describe('parsePagination', () => {
Expand Down

0 comments on commit 61761aa

Please sign in to comment.