Skip to content

Commit

Permalink
Merge branch 'main' into 8167-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax authored Aug 27, 2024
2 parents 23c26b1 + 63c3e19 commit 9ddb71b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/compass-e2e-tests/tests/search-indexes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ describe('Search Indexes', function () {
await browser.dropIndex(indexName);
});

it('renders search indexes tab disabled', async function () {
// TODO(COMPASS-8220): Un-skip this test
(name === 'Atlas Free Cluster'
? it.skip
: it)('renders search indexes tab disabled', async function () {
const searchTab = await browser.$(
Selectors.indexesSegmentedTab('search-indexes')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,36 @@ describe('ConnectionStorage', function () {
expect(JSON.parse(content).connectionInfo.id).to.be.equal(id);
});

it('saves a connection with all ConnectionOptions set', async function () {
const id = new UUID().toString();
const connectionOptions: Required<ConnectionInfo['connectionOptions']> = {
connectionString: 'mongodb://localhost:27017/',
sshTunnel: { host: 'localhost', port: 2222, username: 'foobar' },
useApplicationLevelProxy: true,
oidc: {},
fleOptions: { storeCredentials: false },
lookup: () => ({} as any),
};
await connectionStorage.save({
connectionInfo: {
id,
connectionOptions,
},
});
delete (connectionOptions as any).lookup; // intentionally not stored

const content = await fs.readFile(
getConnectionFilePath(tmpDir, id),
'utf-8'
);
expect(
JSON.parse(content).connectionInfo.connectionOptions
).to.deep.equal(connectionOptions);
expect(
(await connectionStorage.load({ id }))?.connectionOptions
).to.deep.equal(connectionOptions);
});

it('saves a connection with arbitrary authMechanism', async function () {
const id = new UUID().toString();
await connectionStorage.save({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const ConnectionSchema: z.Schema<ConnectionWithLegacyProps> = z
useSystemCA: z.boolean().optional(), // Unused but may be present in legacy files
oidc: z.any().optional(),
fleOptions: z.any().optional(),
useApplicationLevelProxy: z.boolean().optional(),
}),
})
.optional(),
Expand Down

0 comments on commit 9ddb71b

Please sign in to comment.