Skip to content

Commit

Permalink
test: run one
Browse files Browse the repository at this point in the history
  • Loading branch information
alenakhineika committed May 24, 2024
1 parent 07efddf commit f159919
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions src/test/suite/oidc.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import os from 'os';
import path from 'path';
import chai, { expect } from 'chai';
Expand All @@ -24,6 +25,8 @@ import { ConnectionString } from 'mongodb-connection-string-url';
import launchMongoShell from '../../commands/launchMongoShell';
import { getFullRange } from './suggestTestHelpers';

import * as util from 'util';

chai.use(chaiAsPromised);

function hash(input: string): string {
Expand Down Expand Up @@ -381,11 +384,17 @@ suite('OIDC Tests', function () {
};
};

expect(
const isConnected =
await testConnectionController.addNewConnectionStringAndConnect(
connectionString
)
).to.be.true;
);

expect(isConnected).to.be.true;

console.log('isConnected----------------------');
console.log(`${util.inspect(isConnected)}`);
console.log('----------------------');

afterReauth = true;

// Trigger a command on data service for reauthentication
Expand All @@ -394,6 +403,9 @@ suite('OIDC Tests', function () {
.getActiveDataService()
?.count('x.y', {})
.catch((error) => {
console.log('error----------------------');
console.log(`${util.inspect(error)}`);
console.log('----------------------');
expect(error.message).to.equal('Reauthentication declined by user');
});
}
Expand All @@ -402,6 +414,15 @@ suite('OIDC Tests', function () {

// Because we declined the auth in showInformationMessage above
expect(tokenFetchCalls).to.equal(1);

console.log(
'testConnectionController.isCurrentlyConnected()----------------------'
);
console.log(
`${util.inspect(testConnectionController.isCurrentlyConnected())}`
);
console.log('----------------------');

expect(testConnectionController.isCurrentlyConnected()).to.be.false;
});

Expand Down

0 comments on commit f159919

Please sign in to comment.