Skip to content

Commit

Permalink
test(list_collections): Merge similar tests and test contexts into one
Browse files Browse the repository at this point in the history
  • Loading branch information
gribnoysup committed Nov 5, 2021
1 parent 516e28d commit fa8a514
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions test/unit/operations/list_collections.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,12 @@ describe('ListCollectionsOperation', function () {
});
});

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

it('sets nameOnly to false', function () {
expect(operation).to.have.property('nameOnly', false);
});
});

context('when authorizedCollections is not provided', function () {
const operation = new ListCollectionsOperation(db, {}, { dbName: db });

it('sets authorizedCollections to false', function () {
expect(operation).to.have.property('authorizedCollections', false);
Expand Down Expand Up @@ -137,24 +133,10 @@ describe('ListCollectionsOperation', function () {
});
});

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

it('sets nameOnly to false', function () {
expect(operation.generateCommand()).to.deep.equal({
listCollections: 1,
cursor: {},
filter: {},
nameOnly: false,
authorizedCollections: false
});
});
});

context('when authorizedCollections is not provided', function () {
const operation = new ListCollectionsOperation(db, {}, { dbName: db });

it('sets authorizedCollections to false', function () {
it('sets nameOnly and authorizedCollections properties to false', function () {
expect(operation.generateCommand()).to.deep.equal({
listCollections: 1,
cursor: {},
Expand Down

0 comments on commit fa8a514

Please sign in to comment.