Skip to content

Commit

Permalink
Changed more relevant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ibobo committed May 30, 2023
1 parent 396a590 commit 01974cd
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 134 deletions.
32 changes: 0 additions & 32 deletions packages/firestore/e2e/Query/where.and.filter.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,38 +213,6 @@ describe(' firestore().collection().where(AND Filters)', function () {
}
});

it('throws if query has array-contains-any & in filter', function () {
try {
firebase
.firestore()
.collection(COLLECTION)
.where(
Filter.and(Filter('foo.bar', 'array-contains-any', [1]), Filter('foo.bar', 'in', [2])),
);

return Promise.reject(new Error('Did not throw an Error.'));
} catch (error) {
error.message.should.containEql(
"You cannot use 'in' filters with 'array-contains-any' filters",
);
return Promise.resolve();
}
});

it('throws if query has multiple in filter', function () {
try {
firebase
.firestore()
.collection(COLLECTION)
.where(Filter.and(Filter('foo.bar', 'in', [1]), Filter('foo.bar', 'in', [2])));

return Promise.reject(new Error('Did not throw an Error.'));
} catch (error) {
error.message.should.containEql("You cannot use more than one 'in' filter");
return Promise.resolve();
}
});

it("should throw error when using 'not-in' operator twice", async function () {
const ref = firebase.firestore().collection(COLLECTION);

Expand Down
30 changes: 0 additions & 30 deletions packages/firestore/e2e/Query/where.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,36 +159,6 @@ describe('firestore().collection().where()', function () {
}
});

it('throws if query has array-contains-any & in filter', function () {
try {
firebase
.firestore()
.collection(COLLECTION)
.where('foo.bar', 'array-contains-any', [1])
.where('foo.bar', 'in', [2]);
return Promise.reject(new Error('Did not throw an Error.'));
} catch (error) {
error.message.should.containEql(
"You cannot use 'in' filters with 'array-contains-any' filters",
);
return Promise.resolve();
}
});

it('throws if query has multiple in filter', function () {
try {
firebase
.firestore()
.collection(COLLECTION)
.where('foo.bar', 'in', [1])
.where('foo.bar', 'in', [2]);
return Promise.reject(new Error('Did not throw an Error.'));
} catch (error) {
error.message.should.containEql("You cannot use more than one 'in' filter");
return Promise.resolve();
}
});

/* Queries */

it('returns with where equal filter', async function () {
Expand Down
32 changes: 0 additions & 32 deletions packages/firestore/e2e/Query/where.filter.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,38 +171,6 @@ describe('firestore().collection().where(Filters)', function () {
}
});

it('throws if query has array-contains-any & in filter', function () {
try {
firebase
.firestore()
.collection(COLLECTION)
.where(Filter('foo.bar', 'array-contains-any', [1]))
.where(Filter('foo.bar', 'in', [2]));

return Promise.reject(new Error('Did not throw an Error.'));
} catch (error) {
error.message.should.containEql(
"You cannot use 'in' filters with 'array-contains-any' filters",
);
return Promise.resolve();
}
});

it('throws if query has multiple in filter', function () {
try {
firebase
.firestore()
.collection(COLLECTION)
.where(Filter('foo.bar', 'in', [1]))
.where(Filter('foo.bar', 'in', [2]));

return Promise.reject(new Error('Did not throw an Error.'));
} catch (error) {
error.message.should.containEql("You cannot use more than one 'in' filter");
return Promise.resolve();
}
});

it("should throw error when using 'not-in' operator twice", async function () {
const ref = firebase.firestore().collection(COLLECTION);

Expand Down
40 changes: 0 additions & 40 deletions packages/firestore/e2e/Query/where.or.filter.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,46 +318,6 @@ describe('firestore().collection().where(OR Filters)', function () {
}
});

it('throws if query has array-contains-any & in filter', function () {
try {
firebase
.firestore()
.collection(COLLECTION)
.where(
Filter.or(
Filter.and(Filter('foo.bar', 'array-contains-any', [1]), Filter('foo.bar', 'in', [2])),
Filter.and(Filter('foo.bar', 'array-contains-any', [1]), Filter('foo.bar', 'in', [2])),
),
);

return Promise.reject(new Error('Did not throw an Error.'));
} catch (error) {
error.message.should.containEql(
"You cannot use 'in' filters with 'array-contains-any' filters",
);
return Promise.resolve();
}
});

it('throws if query has multiple in filter', function () {
try {
firebase
.firestore()
.collection(COLLECTION)
.where(
Filter.or(
Filter.and(Filter('foo.bar', 'in', [1]), Filter('foo.bar', 'in', [2])),
Filter.and(Filter('foo.bar', 'in', [1]), Filter('foo.bar', 'in', [2])),
),
);

return Promise.reject(new Error('Did not throw an Error.'));
} catch (error) {
error.message.should.containEql("You cannot use more than one 'in' filter");
return Promise.resolve();
}
});

it("should throw error when using 'not-in' operator twice", async function () {
const ref = firebase.firestore().collection(COLLECTION);

Expand Down

0 comments on commit 01974cd

Please sign in to comment.