Skip to content

Commit

Permalink
small fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
tegefaulkes committed Nov 18, 2021
1 parent 861313b commit 905e86b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions tests/bin/agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,9 @@ describe('CLI agent', () => {
{ encoding: 'utf-8' },
);

const verify = await activeAgent.sessions.verifyToken(
await activeAgent.sessions.verifyToken(
content as SessionToken,
);
expect(verify).toBeTruthy();
});
test('fail to lock session if agent is not running', async () => {
const result = await testUtils.pkWithStdio([
Expand Down
6 changes: 2 additions & 4 deletions tests/client/clientService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,9 @@ describe('Client service', () => {

const res = await requestJWT(passwordMessage);
expect(typeof res.getToken()).toBe('string');
const result = await polykeyAgent.sessions.verifyToken(
await polykeyAgent.sessions.verifyToken(
res.getToken() as SessionToken,
);
expect(result).toBeTruthy();
});
test('can refresh session', async () => {
const requestJWT = grpcUtils.promisifyUnaryCall<sessionsPB.Token>(
Expand All @@ -253,8 +252,7 @@ describe('Client service', () => {
const res2 = await sessionRefresh(emptyMessage, callCredentialsRefresh);
expect(typeof res2.getToken()).toBe('string');
const token2 = res2.getToken() as SessionToken;
const result = await polykeyAgent.sessions.verifyToken(token2);
expect(result).toBeTruthy();
await polykeyAgent.sessions.verifyToken(token2);
expect(token1).not.toEqual(token2);
});
test.todo('actions over GRPC refresh the session'); // How do I even test this?
Expand Down

0 comments on commit 905e86b

Please sign in to comment.