Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added failing test for #3678 #3679

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions spec/ParseQuery.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,41 @@ describe('Parse.Query testing', () => {
});
});

it("dontSelect and equalTo (#3678)", function(done) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, @xor22h.
Would you mind writing the actual test "name" or what we should expect this test to cover, instead of pointing to the issue? I think it makes it easier for readers.

var AuthorObject = Parse.Object.extend("Author");
var BlockedObject = Parse.Object.extend("Blocked");
var PostObject = Parse.Object.extend("Post");

var postAuthor = null;
var requestUser = null;

return new AuthorObject({ name: "Julius"}).save().then((user) => {
postAuthor = user;
return new AuthorObject({ name: "Bob"}).save();
}).then((user) => {
requestUser = user;
var objects = [
new PostObject({ author: postAuthor, title: "Lorem ipsum" }),
new PostObject({ author: requestUser, title: "Kafka" }),
new PostObject({ author: requestUser, title: "Brown fox" }),
new BlockedObject({ blockedBy: postAuthor, blockedUser: requestUser})
];
return Parse.Object.saveAll(objects);
}).then(() => {
var banListQuery = new Parse.Query(BlockedObject);
banListQuery.equalTo("blockedUser", requestUser);

return new Parse.Query(PostObject)
.equalTo("author", postAuthor)
.doesNotMatchKeyInQuery("author", "blockedBy", banListQuery)
.find()
.then((r) => {
expect(r.length).toEqual(0);
done();
}, done.fail);
})
});

it("object with length", function(done) {
var TestObject = Parse.Object.extend("TestObject");
var obj = new TestObject();
Expand Down