You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that we've refactored the gallery sorting code to compute a sort index for every promise and sort by that single number, we could make the tests simpler by dropping the need for pairwise comparisons.
Instead just define a big list of different kinds of promises, listed in the order they ought to be in in a user's gallery. Then just compute the sort index for each promise and check that those numbers are sorted in ascending order.
Relevant types of promises, listed in the order they should sort in:
tini and tdue and tfin all null (or undefined?)
tini a week ago and tdue and tfin both null
tini a day ago and tdue and tfin both null
tini is anything, tdue is today, tfin is null [scheldist 0]
tini is anything, tdue is 2 days ago, tfin is null [scheldist 1]
tini is anything, tdue is 2 days from now, tfin is null [scheldist 2]
tini is anything, tdue is 4 days ago, tfin is null [scheldist 3]
tini is anything, tdue is 4 days from now, tfin is null [scheldist 4]
tini is anything, tdue is 12 days ago, tfin is null [scheldist 5]
tini is anything, tdue is 24 days ago, tfin is null [scheldist 6]
tini is anything, tdue is 7 days from now, tfin is null [scheldist 7]
tini is anything, tdue is anything, tfin is yesterday
tini is anything, tdue is anything, tfin is a week ago
So number 1 is a promise that's messed up and should sort to the very top, next are numbers 2-3 which sort by increasing creation date because they have no due dates, after that are numbers 4-11 which are incomplete promises sorted by urgency (Schelling distance), and finally numbers 12-13 are completed promises sorted by decreasing completion date.
For the "is anything" values it shouldn't matter to the sorting how those are filled in so just pick random dates and make some of them are null to ensure that doesn't break anything either.
The text was updated successfully, but these errors were encountered:
Now that we've refactored the gallery sorting code to compute a sort index for every promise and sort by that single number, we could make the tests simpler by dropping the need for pairwise comparisons.
Instead just define a big list of different kinds of promises, listed in the order they ought to be in in a user's gallery. Then just compute the sort index for each promise and check that those numbers are sorted in ascending order.
Relevant types of promises, listed in the order they should sort in:
tini
andtdue
andtfin
all null (or undefined?)tini
a week ago andtdue
andtfin
both nulltini
a day ago andtdue
andtfin
both nulltini
is anything,tdue
is today,tfin
is null [scheldist 0]tini
is anything,tdue
is 2 days ago,tfin
is null [scheldist 1]tini
is anything,tdue
is 2 days from now,tfin
is null [scheldist 2]tini
is anything,tdue
is 4 days ago,tfin
is null [scheldist 3]tini
is anything,tdue
is 4 days from now,tfin
is null [scheldist 4]tini
is anything,tdue
is 12 days ago,tfin
is null [scheldist 5]tini
is anything,tdue
is 24 days ago,tfin
is null [scheldist 6]tini
is anything,tdue
is 7 days from now,tfin
is null [scheldist 7]tini
is anything,tdue
is anything,tfin
is yesterdaytini
is anything,tdue
is anything,tfin
is a week agoSo number 1 is a promise that's messed up and should sort to the very top, next are numbers 2-3 which sort by increasing creation date because they have no due dates, after that are numbers 4-11 which are incomplete promises sorted by urgency (Schelling distance), and finally numbers 12-13 are completed promises sorted by decreasing completion date.
For the "is anything" values it shouldn't matter to the sorting how those are filled in so just pick random dates and make some of them are null to ensure that doesn't break anything either.
The text was updated successfully, but these errors were encountered: