Skip to content

Commit 00a9c16

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

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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');
@@ -1660,7 +1663,8 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16601663
// collection with the filter { "_id": 1 }.
16611664
// Assert one document is returned containing the field
16621665
// { "encryptedUnindexed": "encrypted unindexed value" }.
1663-
const result = await encryptedClient.findOne({ _id: 1 });
1666+
const collection = encryptedClient.db('db').collection('explicit_encryption');
1667+
const result = await collection.findOne({ _id: 1 });
16641668
expect(result.encryptedIndexed).to.equal('encrypted unindexed value');
16651669
});
16661670
});
@@ -1699,7 +1703,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
16991703
// algorithm: "Unindexed",
17001704
// }
17011705
// Store the result in payload.
1702-
payload = await clientEncryption.encrypt('encrypted indexed value', {
1706+
payload = await clientEncryption.encrypt('encrypted unindexed value', {
17031707
keyId: key1Id,
17041708
algorithm: 'Unindexed'
17051709
});

0 commit comments

Comments
 (0)