Skip to content

Commit c9d468c

Browse files
committed
test(NODE-4227): fix tests
1 parent d6e5e44 commit c9d468c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

test/integration/client-side-encryption/client_side_encryption.prose.test.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const eeMetadata = {
4444
requires: {
4545
clientSideEncryption: true,
4646
mongodb: '>=6.0.0',
47-
topology: ['replicaset', 'sharded', 'single']
47+
topology: ['replicaset', 'sharded']
4848
}
4949
};
5050

@@ -1545,7 +1545,8 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
15451545
// collection with the filter { "encryptedIndexed": <findPayload> }.
15461546
// Assert one document is returned containing the field
15471547
// { "encryptedIndexed": "encrypted indexed value" }.
1548-
const result = await encryptedClient.findOne({ encryptedIndexed: findPayload });
1548+
const collection = encryptedClient.db('db').collection('explicit_encryption');
1549+
const result = await collection.findOne({ encryptedIndexed: findPayload });
15491550
expect(result.encryptedIndexed).to.equal('encrypted indexed value');
15501551
});
15511552
});
@@ -1613,7 +1614,8 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16131614
// Assert less than 10 documents are returned. 0 documents may be returned.
16141615
// Assert each returned document contains the field
16151616
// { "encryptedIndexed": "encrypted indexed value" }.
1616-
const result = await encryptedClient.find({ encryptedIndexed: findPayload }).toArray();
1617+
const collection = encryptedClient.db('db').collection('explicit_encryption');
1618+
const result = await collection.find({ encryptedIndexed: findPayload }).toArray();
16171619
expect(result.length).to.be.below(10);
16181620
for (const doc of result) {
16191621
expect(doc.encryptedIndexed).to.equal('encrypted indexed value');
@@ -1625,7 +1627,8 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16251627
// collection with the filter { "encryptedIndexed": <findPayload2> }.
16261628
// Assert 10 documents are returned. Assert each returned document contains the
16271629
// field { "encryptedIndexed": "encrypted indexed value" }.
1628-
const result = await encryptedClient.find({ encryptedIndexed: findPayload2 }).toArray();
1630+
const collection = encryptedClient.db('db').collection('explicit_encryption');
1631+
const result = await collection.find({ encryptedIndexed: findPayload2 }).toArray();
16291632
expect(result.length).to.equal(10);
16301633
for (const doc of result) {
16311634
expect(doc.encryptedIndexed).to.equal('encrypted indexed value');
@@ -1651,6 +1654,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16511654
// Use encryptedClient to insert the document { "_id": 1, "encryptedUnindexed": <insertPayload> }
16521655
// into db.explicit_encryption.
16531656
await encryptedClient.db('db').collection('explicit_encryption').insertOne({
1657+
_id: 1,
16541658
encryptedIndexed: insertPayload
16551659
});
16561660
});
@@ -1660,7 +1664,8 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16601664
// collection with the filter { "_id": 1 }.
16611665
// Assert one document is returned containing the field
16621666
// { "encryptedUnindexed": "encrypted unindexed value" }.
1663-
const result = await encryptedClient.findOne({ _id: 1 });
1667+
const collection = encryptedClient.db('db').collection('explicit_encryption');
1668+
const result = await collection.findOne({ _id: 1 });
16641669
expect(result.encryptedIndexed).to.equal('encrypted unindexed value');
16651670
});
16661671
});
@@ -1699,7 +1704,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16991704
// algorithm: "Unindexed",
17001705
// }
17011706
// Store the result in payload.
1702-
payload = await clientEncryption.encrypt('encrypted indexed value', {
1707+
payload = await clientEncryption.encrypt('encrypted unindexed value', {
17031708
keyId: key1Id,
17041709
algorithm: 'Unindexed'
17051710
});

0 commit comments

Comments
 (0)