feat: simplify ticket links to action and ticket (KAN-12)
This commit is contained in:
@@ -41,8 +41,6 @@ try {
|
||||
'Platform delivery',
|
||||
'Child tickets',
|
||||
'Nested child with a long title that must wrap on mobile',
|
||||
'Incoming',
|
||||
'Blocked by',
|
||||
]) {
|
||||
assert.equal(
|
||||
await section()
|
||||
@@ -52,6 +50,13 @@ try {
|
||||
text,
|
||||
);
|
||||
}
|
||||
assert.equal(
|
||||
await section()
|
||||
.locator('[data-ticket-link]')
|
||||
.getByText('Blocked by', { exact: true })
|
||||
.isVisible(),
|
||||
true,
|
||||
);
|
||||
const collapse = section().getByRole('button', {
|
||||
name: 'Collapse children of ENG-41',
|
||||
});
|
||||
@@ -68,16 +73,7 @@ try {
|
||||
);
|
||||
await page.keyboard.press('Space');
|
||||
assert.equal(await collapse.getAttribute('aria-expanded'), 'true');
|
||||
await control('Link type').focus();
|
||||
await page.keyboard.press('Tab');
|
||||
assert.equal(
|
||||
await control('This ticket').evaluate(
|
||||
(el) =>
|
||||
el === document.activeElement &&
|
||||
el.matches(':focus-visible'),
|
||||
),
|
||||
true,
|
||||
);
|
||||
await control('Action').focus();
|
||||
await page.keyboard.press('Tab');
|
||||
assert.equal(
|
||||
await control('Linked ticket').evaluate(
|
||||
@@ -130,7 +126,10 @@ try {
|
||||
link_direction: 'source',
|
||||
linked_ticket_id: 41,
|
||||
});
|
||||
await section().getByText('Outgoing', { exact: true }).waitFor();
|
||||
await section()
|
||||
.locator('[data-ticket-link]')
|
||||
.getByText('Blocks', { exact: true })
|
||||
.waitFor();
|
||||
await page.waitForFunction(
|
||||
() => document.querySelector('#linked_ticket_id')?.value === '',
|
||||
);
|
||||
@@ -152,11 +151,10 @@ try {
|
||||
);
|
||||
|
||||
await visit('?noLinks');
|
||||
await control('This ticket').selectOption('counterpart');
|
||||
await control('Action').selectOption('1:counterpart');
|
||||
await control('Linked ticket').selectOption('41');
|
||||
await section()
|
||||
.locator('form')
|
||||
.last()
|
||||
.locator('p[aria-live="polite"]')
|
||||
.getByText('Blocked by', { exact: true })
|
||||
.waitFor();
|
||||
request = page.waitForRequest(
|
||||
@@ -168,7 +166,10 @@ try {
|
||||
link_direction: 'counterpart',
|
||||
linked_ticket_id: 41,
|
||||
});
|
||||
await section().getByText('Incoming', { exact: true }).waitFor();
|
||||
await section()
|
||||
.locator('[data-ticket-link]')
|
||||
.getByText('Blocked by', { exact: true })
|
||||
.waitFor();
|
||||
|
||||
await visit('?rejectLink');
|
||||
await control('Linked ticket').selectOption('41');
|
||||
@@ -177,7 +178,7 @@ try {
|
||||
.getByText('Choose another ticket.', { exact: true })
|
||||
.waitFor();
|
||||
assert.equal(await control('Linked ticket').inputValue(), '41');
|
||||
for (const label of ['Link type', 'Linked ticket']) {
|
||||
for (const label of ['Action', 'Linked ticket']) {
|
||||
assert.equal(await control(label).getAttribute('aria-invalid'), 'true');
|
||||
}
|
||||
await page.route('**/tickets/42/links', (route) => route.abort('failed'));
|
||||
|
||||
Reference in New Issue
Block a user