mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-11 09:51:30 +00:00
fix(tests): update timeline item locators and improve response status code assertion (#8202)
This commit is contained in:
@@ -145,6 +145,7 @@ const TimelineItem = ({
|
||||
aria-expanded={isExpanded}
|
||||
onClick={toggleExpand}
|
||||
onKeyDown={handleRowKeyDown}
|
||||
data-testid="timeline-item-header"
|
||||
>
|
||||
<div className="tl-col-chev">
|
||||
{isExpanded ? <IconChevronDown size={14} strokeWidth={2} /> : <IconChevronRight size={14} strokeWidth={2} />}
|
||||
|
||||
@@ -109,7 +109,7 @@ const Timeline = ({ collection, item }) => {
|
||||
|
||||
if (isGrpcRequest) {
|
||||
return (
|
||||
<div key={index} className="timeline-event">
|
||||
<div key={index} className="timeline-event" data-testid="timeline-item">
|
||||
<GrpcTimelineItem
|
||||
timestamp={eventTimestamp}
|
||||
request={request}
|
||||
@@ -124,7 +124,7 @@ const Timeline = ({ collection, item }) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<div key={index} className="timeline-event">
|
||||
<div key={index} className="timeline-event" data-testid="timeline-item">
|
||||
<TimelineItem
|
||||
timestamp={timestamp}
|
||||
request={request}
|
||||
@@ -139,7 +139,7 @@ const Timeline = ({ collection, item }) => {
|
||||
|
||||
if (entry.type === 'oauth2' && entry._oauth2Child) {
|
||||
return (
|
||||
<div key={index} className="timeline-event">
|
||||
<div key={index} className="timeline-event" data-testid="timeline-item">
|
||||
<TimelineItem
|
||||
timestamp={entry.timestamp}
|
||||
request={entry._oauth2Child.request}
|
||||
@@ -155,7 +155,7 @@ const Timeline = ({ collection, item }) => {
|
||||
|
||||
if (entry.type === 'scripted-request') {
|
||||
return (
|
||||
<div key={index} className="timeline-event">
|
||||
<div key={index} className="timeline-event" data-testid="timeline-item">
|
||||
<TimelineItem
|
||||
timestamp={entry.timestamp}
|
||||
request={entry.data?.request}
|
||||
|
||||
@@ -62,7 +62,7 @@ test('Request inherits No Auth from the folder — collection Bearer Token is ov
|
||||
});
|
||||
|
||||
await test.step('Verify the response status code is 401 Unauthorized', async () => {
|
||||
await expect(locators.response.statusCode()).toContainText('401');
|
||||
await expect(locators.response.statusCode()).toContainText('401 Unauthorized');
|
||||
});
|
||||
|
||||
await test.step('Open the latest timeline entry and verify no Authorization header was sent', async () => {
|
||||
|
||||
@@ -130,9 +130,9 @@ export const buildCommonLocators = (page: Page) => ({
|
||||
jsonTreeLine: () => page.locator('.response-pane .object-content')
|
||||
},
|
||||
timeline: {
|
||||
items: () => page.locator('.timeline-item'),
|
||||
lastItem: () => page.locator('.timeline-item').last(),
|
||||
itemHeader: (item: Locator) => item.locator('.oauth-request-item-header'),
|
||||
items: () => page.getByTestId('timeline-item'),
|
||||
lastItem: () => page.getByTestId('timeline-item').last(),
|
||||
itemHeader: (item: Locator) => item.getByTestId('timeline-item-header'),
|
||||
clearButton: () => page.getByRole('button', { name: 'Clear Timeline' })
|
||||
},
|
||||
plusMenu: {
|
||||
|
||||
Reference in New Issue
Block a user