🐛(e2e) sync doc grid sorting check
The sorting check was not the same between what django provide and what the e2e test check, it was giving some flakiness. Django seems to ignore the punctuation (space) in its sorting. We improve other test to be more robust as well.
This commit is contained in:
@@ -125,8 +125,10 @@ test.describe('Documents Grid', () => {
|
||||
expect(
|
||||
textDocNameRow1Asc &&
|
||||
textDocNameRow2Asc &&
|
||||
textDocNameRow1Asc.toLocaleLowerCase() <=
|
||||
textDocNameRow2Asc.toLocaleLowerCase(),
|
||||
textDocNameRow1Asc.localeCompare(textDocNameRow2Asc, 'en', {
|
||||
caseFirst: 'false',
|
||||
ignorePunctuation: true,
|
||||
}) <= 0,
|
||||
).toBeTruthy();
|
||||
|
||||
// Ordering Desc
|
||||
@@ -145,8 +147,10 @@ test.describe('Documents Grid', () => {
|
||||
expect(
|
||||
textDocNameRow1Desc &&
|
||||
textDocNameRow2Desc &&
|
||||
textDocNameRow1Desc.toLocaleLowerCase() >=
|
||||
textDocNameRow2Desc.toLocaleLowerCase(),
|
||||
textDocNameRow1Desc.localeCompare(textDocNameRow2Desc, 'en', {
|
||||
caseFirst: 'false',
|
||||
ignorePunctuation: true,
|
||||
}) >= 0,
|
||||
).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user