Skip to content

Commit

Permalink
Repro of #1946
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Apr 2, 2024
1 parent f7d3708 commit 2e92d9f
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions test/tests-live-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ db.version(2).stores({
foo: "++id",
outbound: "++,name",
friends: "++id, name, age",
multiEntry: "id, *tags"
multiEntry: "id, *tags",
issue1946: "++id, [name+age], [name+age+id]"
});

db.on('populate', ()=> {
Expand Down Expand Up @@ -508,6 +509,14 @@ const mutsAndExpects = () => [
multiEntry2: [3],
multiEntry3: [{id: 2, tags: ["Apa", "x", "y"]}]
}
],
// Issue https://github.com/dexie/Dexie.js/issues/1946
[
() => db.issue1946.add({name: "A", age: 20}),
{
compoundOrderBy: [{name: "A", age: 20, id: 1}],
compoundOrderByWithAutoIncKey: [{name: "A", age: 20, id: 1}]
}
]
]

Expand Down Expand Up @@ -544,6 +553,10 @@ promisedTest("Full use case matrix", async ()=>{
multiEntry1: () => db.multiEntry.where('tags').startsWith('A').primaryKeys(),
multiEntry2: () => db.multiEntry.where({tags: "fooTag"}).primaryKeys(),
multiEntry3: () => db.multiEntry.where({tags: "x"}).toArray(),

// Issue https://github.com/dexie/Dexie.js/issues/1946
compoundOrderBy: () => db.issue1946.orderBy('[name+age]').toArray(),
compoundOrderByWithAutoIncKey: () => db.issue1946.orderBy('[name+age+id]').toArray(),
};
const expectedInitialResults = {
itemsToArray: [{id: 1}, {id: 2}, {id: 3}],
Expand All @@ -569,7 +582,11 @@ promisedTest("Full use case matrix", async ()=>{

multiEntry1: [],
multiEntry2: [],
multiEntry3: []
multiEntry3: [],

// Issue https://github.com/dexie/Dexie.js/issues/1946
compoundOrderBy: [],
compoundOrderByWithAutoIncKey: []
}
let flyingNow = 0;
//let signal = new Signal();
Expand Down

0 comments on commit 2e92d9f

Please sign in to comment.