Skip to content
This repository was archived by the owner on Apr 27, 2023. It is now read-only.

Commit 33364ef

Browse files
committed
fix(#680): fixed tests according to change
1 parent 4a0db3b commit 33364ef

2 files changed

Lines changed: 30 additions & 29 deletions

File tree

tests/Javascript/Components/Tables/RoomTable.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,6 @@ test('should sort rooms based on sorting component data', () => {
202202
expect(wrapper.vm.currentSort).toBe('attributes.capacity_sitting');
203203
expect(wrapper.vm.currentSortDir).toBe('desc');
204204

205-
expect(wrapper.vm.sortedRooms).toStrictEqual(globPropsDataMultiRoom.paginator.data);
205+
expect(wrapper.vm.sortedRooms).toStrictEqual(globPropsDataMultiRoom.paginator.data.reverse());
206206

207207
})

tests/Javascript/Pages/Admin/BookingRequests/Index.spec.js

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,40 @@ beforeEach(() => {
2121

2222
});
2323

24+
let props = {
25+
rooms: [{
26+
id: 1,
27+
name: "name",
28+
building: "building",
29+
number: "1",
30+
floor: 1,
31+
status: "unavailable"
32+
}],
33+
paginator: {
34+
data: [{
35+
id: 1,
36+
name: "name",
37+
building: "building",
38+
number: "1",
39+
floor: 1,
40+
status: "unavailable"
41+
}]
42+
}
43+
}
44+
2445
test('should mount without crashing', () => {
25-
const wrapper = shallowMount(Index, {localVue})
46+
const wrapper = shallowMount(Index,
47+
{
48+
localVue,
49+
propsData: props
50+
})
2651
})
2752

2853

2954
test('should set dataRooms from props', () => {
3055
const wrapper = shallowMount(Index, {
3156
localVue,
32-
propsData: {
33-
rooms: [{
34-
id: 1,
35-
name: "name",
36-
building: "building",
37-
number: "1",
38-
floor: 1,
39-
status: "unavailable"
40-
}]
41-
}
57+
propsData: props
4258
})
4359

4460
expect(wrapper.vm.dataRooms).toStrictEqual(
@@ -56,19 +72,7 @@ test('should set dataRooms from props', () => {
5672
test('post sent to filterRooms route', () => {
5773
const wrapper = shallowMount(Index, {
5874
localVue,
59-
propsData: {
60-
rooms: [{
61-
id: 1,
62-
name: "name",
63-
building: "building",
64-
number: "1",
65-
floor: 1,
66-
status: "unavailable",
67-
attributes: {
68-
food: true
69-
}
70-
}]
71-
}
75+
propsData: props
7276
});
7377
wrapper.vm.filterRoomsJson({"food": true});
7478
expect(wrapper.vm.dataRooms).toStrictEqual(
@@ -78,10 +82,7 @@ test('post sent to filterRooms route', () => {
7882
building: "building",
7983
number: "1",
8084
floor: 1,
81-
status: "unavailable",
82-
attributes: {
83-
food: true
84-
}
85+
status: "unavailable"
8586
}]);
8687

8788
})

0 commit comments

Comments
 (0)