Skip to content

Commit

Permalink
Fix test results when the same request is executed more than 1 time (u…
Browse files Browse the repository at this point in the history
…sebruno#2522) (usebruno#2551)

Co-authored-by: Alcaraz, Bruno <[email protected]>
  • Loading branch information
BruAlcaraz and BruAlcarazUlg authored Jul 25, 2024
1 parent c99da3a commit 1d2e06d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1566,29 +1566,29 @@ export const collectionsSlice = createSlice({
}

if (type === 'request-sent') {
const item = collection.runnerResult.items.find((i) => i.uid === request.uid);
const item = collection.runnerResult.items.findLast((i) => i.uid === request.uid);
item.status = 'running';
item.requestSent = action.payload.requestSent;
}

if (type === 'response-received') {
const item = collection.runnerResult.items.find((i) => i.uid === request.uid);
const item = collection.runnerResult.items.findLast((i) => i.uid === request.uid);
item.status = 'completed';
item.responseReceived = action.payload.responseReceived;
}

if (type === 'test-results') {
const item = collection.runnerResult.items.find((i) => i.uid === request.uid);
const item = collection.runnerResult.items.findLast((i) => i.uid === request.uid);
item.testResults = action.payload.testResults;
}

if (type === 'assertion-results') {
const item = collection.runnerResult.items.find((i) => i.uid === request.uid);
const item = collection.runnerResult.items.findLast((i) => i.uid === request.uid);
item.assertionResults = action.payload.assertionResults;
}

if (type === 'error') {
const item = collection.runnerResult.items.find((i) => i.uid === request.uid);
const item = collection.runnerResult.items.findLast((i) => i.uid === request.uid);
item.error = action.payload.error;
item.responseReceived = action.payload.responseReceived;
item.status = 'error';
Expand Down

0 comments on commit 1d2e06d

Please sign in to comment.