Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TestRun] Fix tags when use reloadRowFor on multiple executions #3367

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion tcms/testruns/static/testruns/js/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,18 @@ function renderAdditionalInformation (testRunId, execution) {
casesInPlan = Object.keys(casesInPlan).map(id => parseInt(id))

for (const testCase of testCases) {
const row = $(`.test-execution-case-${testCase.id}`)
let rowSelector = `.test-execution-case-${testCase.id}`
// Preferably operate over the exact execution row to prevent
// appending new HTML onto existing values, e.g. Tags. See #3367
//
// Root cause of the bug in #3367 is that some fields contain icons
// and pre-existing HTML coming from the template and we can't call .empty()
// on them. When such TE is parametrized then there are multiple HTML rows
// matching `rowSelector`/`testCase.id`, therefore the UI is appended to many times!
if (execution) {
rowSelector += `.test-execution-${execution.id}`
}
const row = $(rowSelector)

// when loading this page filtered by status some TCs do not exist
// but we don't know about it b/c the above queries are overzealous
Expand Down
Loading