Skip to content

Commit fa8a514

Browse files
committed
test(list_collections): Merge similar tests and test contexts into one
1 parent 516e28d commit fa8a514

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

test/unit/operations/list_collections.test.js

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,12 @@ describe('ListCollectionsOperation', function () {
5151
});
5252
});
5353

54-
context('when nameOnly is not provided', function () {
54+
context('when no options are provided', function () {
5555
const operation = new ListCollectionsOperation(db, {}, { dbName: db });
5656

5757
it('sets nameOnly to false', function () {
5858
expect(operation).to.have.property('nameOnly', false);
5959
});
60-
});
61-
62-
context('when authorizedCollections is not provided', function () {
63-
const operation = new ListCollectionsOperation(db, {}, { dbName: db });
6460

6561
it('sets authorizedCollections to false', function () {
6662
expect(operation).to.have.property('authorizedCollections', false);
@@ -137,24 +133,10 @@ describe('ListCollectionsOperation', function () {
137133
});
138134
});
139135

140-
context('when nameOnly is not provided', function () {
136+
context('when no options are provided', function () {
141137
const operation = new ListCollectionsOperation(db, {}, { dbName: db });
142138

143-
it('sets nameOnly to false', function () {
144-
expect(operation.generateCommand()).to.deep.equal({
145-
listCollections: 1,
146-
cursor: {},
147-
filter: {},
148-
nameOnly: false,
149-
authorizedCollections: false
150-
});
151-
});
152-
});
153-
154-
context('when authorizedCollections is not provided', function () {
155-
const operation = new ListCollectionsOperation(db, {}, { dbName: db });
156-
157-
it('sets authorizedCollections to false', function () {
139+
it('sets nameOnly and authorizedCollections properties to false', function () {
158140
expect(operation.generateCommand()).to.deep.equal({
159141
listCollections: 1,
160142
cursor: {},

0 commit comments

Comments
 (0)