Compare commits

...

2 Commits

Author SHA1 Message Date
Shefali
bd7ad53195 Adds test for sort order 2023-10-19 16:24:12 -07:00
Shefali
bc1ab42b7b Apply sort settings immediately - even when in edit mode. 2023-10-19 12:08:23 -07:00
2 changed files with 24 additions and 4 deletions

View File

@@ -194,6 +194,7 @@ export default {
if (this.isEditing) {
this.filterValue = configuration.filter;
this.hideAll = false;
this.setSort();
this.listActivities();
} else {
this.filterValue = configuration.filter;

View File

@@ -46,6 +46,7 @@ describe('the plugin', function () {
let twoHoursPast = now - 1000 * 60 * 60 * 2;
let oneHourPast = now - 1000 * 60 * 60;
let twoHoursFuture = now + 1000 * 60 * 60 * 2;
let threeHoursFuture = now + 1000 * 60 * 60 * 3;
let planObject = {
identifier: {
key: 'test-plan-object',
@@ -71,6 +72,14 @@ describe('the plugin', function () {
type: 'TEST-GROUP',
color: 'fuchsia',
textColor: 'black'
},
{
name: 'Sed ut perspiciatis two',
start: now,
end: threeHoursFuture,
type: 'TEST-GROUP',
color: 'fuchsia',
textColor: 'black'
}
]
})
@@ -295,7 +304,7 @@ describe('the plugin', function () {
return nextTick(() => {
const items = element.querySelectorAll(LIST_ITEM_CLASS);
expect(items.length).toEqual(2);
expect(items.length).toEqual(3);
});
});
});
@@ -313,7 +322,7 @@ describe('the plugin', function () {
type: TIMELIST_TYPE,
id: 'test-object',
configuration: {
sortOrderIndex: 0,
sortOrderIndex: 2,
futureEventsIndex: 1,
futureEventsDurationIndex: 0,
futureEventsDuration: 0,
@@ -350,7 +359,17 @@ describe('the plugin', function () {
return nextTick(() => {
const items = element.querySelectorAll(LIST_ITEM_CLASS);
expect(items.length).toEqual(1);
expect(items.length).toEqual(2);
});
});
it('activities and sorts them correctly', () => {
mockComposition.emit('add', planObject);
return nextTick(() => {
const items = element.querySelectorAll(LIST_ITEM_CLASS);
expect(items[0].end).toEqual(threeHoursFuture);
expect(items[1].end).toEqual(twoHoursFuture);
});
});
});
@@ -405,7 +424,7 @@ describe('the plugin', function () {
return nextTick(() => {
const items = element.querySelectorAll(LIST_ITEM_CLASS);
expect(items.length).toEqual(1);
expect(items.length).toEqual(2);
});
});
});