2018-12-19 05:40:32 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketOverviewPendingTil < TestCase
|
|
|
|
|
|
|
|
# regression for issue #2367 - cannot sort by Pending Til
|
|
|
|
def test_sorting_by_pending_til
|
|
|
|
name = "overview_pending_til_#{rand(999_999)}"
|
|
|
|
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2018-12-19 05:40:32 +00:00
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
# create 4 tickets, 2 with pending til data and 2 without
|
|
|
|
tickets = []
|
|
|
|
4.times do |i|
|
|
|
|
ticket = ticket_create(
|
|
|
|
data: {
|
2018-12-19 17:31:51 +00:00
|
|
|
customer: 'nico',
|
|
|
|
group: 'Users',
|
|
|
|
title: "pending til ticket #{i}",
|
|
|
|
body: 'test ticket',
|
|
|
|
state: i.odd? ? 'pending close' : 'open',
|
2018-12-19 05:40:32 +00:00
|
|
|
pending_date: '11/24/2018',
|
|
|
|
pending_time: '08:00',
|
|
|
|
}
|
|
|
|
)
|
|
|
|
tickets.push ticket
|
|
|
|
end
|
|
|
|
|
|
|
|
# create and open new overview that has the Pending Til column
|
|
|
|
overview_create(
|
|
|
|
data: {
|
2018-12-19 17:31:51 +00:00
|
|
|
name: name,
|
|
|
|
roles: %w[Admin Agent],
|
|
|
|
selector: {
|
2018-12-19 05:40:32 +00:00
|
|
|
'State' => ['new', 'open', 'closed', 'merged', 'pending close', 'pending reminder'],
|
|
|
|
},
|
|
|
|
attributes: {
|
|
|
|
'pending_time' => true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
overview_open(
|
2020-06-22 09:57:45 +00:00
|
|
|
name: name,
|
2018-12-19 05:40:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# sort by Pending Til
|
|
|
|
click(
|
2020-06-22 09:57:45 +00:00
|
|
|
css: '.content.active table.table th.js-tableHead[data-column-key="pending_time"]',
|
2018-12-19 05:40:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# check if the first and second rows both correctly contain 'pending close'
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active table .js-tableBody tr:nth-child(1)',
|
2018-12-19 05:40:32 +00:00
|
|
|
value: 'pending close',
|
|
|
|
)
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.content.active table .js-tableBody tr:nth-child(2)',
|
2018-12-19 05:40:32 +00:00
|
|
|
value: 'pending close',
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|