Skip to content

Commit

Permalink
SupersetClient guest token test
Browse files Browse the repository at this point in the history
  • Loading branch information
suddjian committed Jan 25, 2022
1 parent ea92d57 commit 8fb08b1
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,26 @@ describe('SupersetClientClass', () => {
);
});

it('uses a guest token when provided', async () => {
expect.assertions(1);

const client = new SupersetClientClass({
protocol,
host,
guestToken: 'abc123',
guestTokenHeaderName: 'guestTokenHeader',
});

await client.init();
await client.get({ url: mockGetUrl });
const fetchRequest = fetchMock.calls(mockGetUrl)[0][1] as CallApi;
expect(fetchRequest.headers).toEqual(
expect.objectContaining({
guestTokenHeader: 'abc123',
}),
);
});

describe('.get()', () => {
it('makes a request using url or endpoint', async () => {
expect.assertions(2);
Expand Down

0 comments on commit 8fb08b1

Please sign in to comment.