fix: adjusted drag and drop
This commit is contained in:
@@ -114,6 +114,9 @@ function makePage(url) {
|
||||
'InvestigateALongUnbrokenTicketTitleThatMustWrapEvenOnTheSmallestMobileScreenWithoutClipping',
|
||||
),
|
||||
];
|
||||
if (params.has('multiple')) {
|
||||
tickets[0].ticket_status.allowed_target_statuses.push(statuses[3]);
|
||||
}
|
||||
for (const column of boardColumns) {
|
||||
column.tickets = tickets.filter(
|
||||
(item) => item.ticket_status.board_column_id === column.id,
|
||||
@@ -167,7 +170,7 @@ function makePage(url) {
|
||||
}
|
||||
if (serve) {
|
||||
server.middlewares.use(async (request, response) => {
|
||||
if (request.method === 'POST') {
|
||||
if (request.method === 'POST' || request.method === 'PATCH') {
|
||||
let body = '';
|
||||
for await (const chunk of request) {
|
||||
body += chunk;
|
||||
@@ -175,12 +178,21 @@ if (serve) {
|
||||
const data = JSON.parse(body);
|
||||
assert.equal(
|
||||
request.url,
|
||||
'/projects/7/tickets/42/status?_method=PATCH',
|
||||
request.method === 'POST'
|
||||
? '/projects/7/tickets/42/status?_method=PATCH'
|
||||
: '/projects/7/tickets/42/status',
|
||||
);
|
||||
assert.deepEqual(Object.keys(data).sort(), [
|
||||
'redirect_to',
|
||||
'ticket_status_id',
|
||||
]);
|
||||
assert.equal(data.redirect_to, 'board');
|
||||
assert.ok([11, 20, 99].includes(Number(data.ticket_status_id)));
|
||||
assert.ok([11, 20, 21, 99].includes(Number(data.ticket_status_id)));
|
||||
const previous = new URL(request.headers.referer);
|
||||
const reject = previous.searchParams.has('reject');
|
||||
if (previous.searchParams.has('slow')) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
}
|
||||
response.writeHead(303, {
|
||||
Location: `/projects/7/board?${reject ? 'reject&rejected' : `target=${data.ticket_status_id}`}`,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user