Skip to content

Commit 60e744b

Browse files
committed
Added test
1 parent 88d96e2 commit 60e744b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/auth/src/api/authentication/token.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,26 @@ describe('requestStsToken', () => {
9595
);
9696
});
9797

98+
it('should use credentials: include when using Firebase Studio', async () => {
99+
const mock = fetch.mock(endpoint, {
100+
'access_token': 'new-access-token',
101+
'expires_in': '3600',
102+
'refresh_token': 'new-refresh-token'
103+
});
104+
105+
auth._logFramework('Mythical');
106+
auth.emulatorConfig = {
107+
host: 'something.cloudworkstations.dev',
108+
port: 443,
109+
options: { disableWarnings: false },
110+
protocol: 'https'
111+
};
112+
await requestStsToken(auth, 'some-refresh-token');
113+
expect(mock.calls[0].fullRequest?.credentials).to.eq('include');
114+
115+
auth.emulatorConfig = null;
116+
});
117+
98118
it('should include whatever headers come from auth impl', async () => {
99119
sinon.stub(auth, '_getAdditionalHeaders').returns(
100120
Promise.resolve({

0 commit comments

Comments
 (0)