不要怂,就是干,撸起袖子干!

Commit bb25c19b by Sushant Committed by GitHub

test: scope working or operator (#8933)

1 parent 335efd6d
Showing with 15 additions and 0 deletions
...@@ -40,6 +40,15 @@ describe(Support.getTestDialectTeaser('Model'), () => { ...@@ -40,6 +40,15 @@ describe(Support.getTestDialectTeaser('Model'), () => {
{ access_level: { [Sequelize.Op.lt]: 4 } } { access_level: { [Sequelize.Op.lt]: 4 } }
] ]
} }
},
issue8473: {
where: {
[Sequelize.Op.or]: {
access_level: 3,
other_value: 10
},
access_level: 5
}
} }
} }
}); });
...@@ -74,6 +83,12 @@ describe(Support.getTestDialectTeaser('Model'), () => { ...@@ -74,6 +83,12 @@ describe(Support.getTestDialectTeaser('Model'), () => {
expect(records).to.have.length(2); expect(records).to.have.length(2);
expect(records[0].get('access_level')).to.equal(3); expect(records[0].get('access_level')).to.equal(3);
expect(records[1].get('access_level')).to.equal(3); expect(records[1].get('access_level')).to.equal(3);
return this.ScopeMe.scope('issue8473').findAll();
})
.then(records => {
expect(records).to.have.length(1);
expect(records[0].get('access_level')).to.equal(5);
expect(records[0].get('other_value')).to.equal(10);
}); });
}); });
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!