Fix test results when the same request is executed more than 1 time (#2522) (#2551)

Co-authored-by: Alcaraz, Bruno <Bruno.Alcaraz@ulgroup.com>
This commit is contained in:
BruAlcaraz 2024-07-25 08:35:00 -03:00 committed by GitHub
parent c99da3a581
commit 1d2e06d419
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1566,29 +1566,29 @@ export const collectionsSlice = createSlice({
} }
if (type === 'request-sent') { 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.status = 'running';
item.requestSent = action.payload.requestSent; item.requestSent = action.payload.requestSent;
} }
if (type === 'response-received') { 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.status = 'completed';
item.responseReceived = action.payload.responseReceived; item.responseReceived = action.payload.responseReceived;
} }
if (type === 'test-results') { 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; item.testResults = action.payload.testResults;
} }
if (type === 'assertion-results') { 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; item.assertionResults = action.payload.assertionResults;
} }
if (type === 'error') { 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.error = action.payload.error;
item.responseReceived = action.payload.responseReceived; item.responseReceived = action.payload.responseReceived;
item.status = 'error'; item.status = 'error';