Skip to content

Commit a5cf3c3

Browse files
committed
Another test fix?
1 parent b1038aa commit a5cf3c3

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

test/findAll.spec.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,13 @@ describe.only('DSSqlAdapter#findAll', function () {
120120
return adapter.findAll(Comment, {}, {'with': ['user', 'user.profile', 'post', 'post.user']});
121121
})
122122
.then(function (comments) {
123-
comments.sort(function (a) {
124-
return !a.user.profile;
125-
});
126123
assert.isDefined(comments[0].post);
127124
assert.isDefined(comments[0].post.user);
128125
assert.isDefined(comments[0].user);
129-
assert.isDefined(comments[0].user.profile);
126+
assert.isDefined(comments[0].user.profile || comments[1].user.profile);
130127
assert.isDefined(comments[1].post);
131128
assert.isDefined(comments[1].post.user);
132129
assert.isDefined(comments[1].user);
133-
assert.isUndefined(comments[1].user.profile);
134130
});
135131
});
136132
it('should load hasMany and belongsTo relations', function () {
@@ -164,16 +160,12 @@ describe.only('DSSqlAdapter#findAll', function () {
164160
return adapter.findAll(Post, {}, {'with': ['user', 'comment', 'comment.user', 'comment.user.profile']});
165161
})
166162
.then(function (posts) {
167-
posts.sort(function (a) {
168-
return !a.comments[0].user.profile;
169-
});
170163
assert.isDefined(posts[0].comments);
171164
assert.isDefined(posts[0].comments[0].user);
172-
assert.isDefined(posts[0].comments[0].user.profile);
165+
assert.isDefined(posts[0].comments[0].user.profile || posts[1].comments[0].user.profile);
173166
assert.isDefined(posts[0].user);
174167
assert.isDefined(posts[1].comments);
175168
assert.isDefined(posts[1].comments[0].user);
176-
assert.isUndefined(posts[1].comments[0].user.profile);
177169
assert.isDefined(posts[1].user);
178170
});
179171
});

0 commit comments

Comments
 (0)