It seems that there's a race condition in the tests related to the attachment menu page. These workflow runs,
Workflow Run-3433329209 and Workflow Run-3433337969, were fired after I submitted changes that solved a merge conflict ( those changes didn't include files related to tests) and the first workflow finished without errors but the other one finished with 1 failing test.
After running the tests a couple of times in my local env, I've found that the test fails when HTML elements created by a describe block remain in the object called document when a new describe block begins, so it creates an object that contains previous HTML tags and the new ones, leading to unexpected behavior. For example, the failing test in Workflow Run-3433337969 expects a document object without any button but one of the previous describe block used two buttons that match one of the validations, so when the elements combine in the document object the functions returns true instead of false.
Possible Solution
keeping with the current approach in PacerSpec.js, We could insert this line above line 10:
document.body.innerHTML=''
This will make sure that the body of the document object is clear before creating the main container of HTML tags for every describe block.
It seems that there's a race condition in the tests related to the attachment menu page. These workflow runs, Workflow Run-3433329209 and Workflow Run-3433337969, were fired after I submitted changes that solved a merge conflict ( those changes didn't include files related to tests) and the first workflow finished without errors but the other one finished with 1 failing test.
After running the tests a couple of times in my local env, I've found that the test fails when
HTML elements
created by adescribe
block remain in the object calleddocument
when a newdescribe
block begins, so it creates an object that contains previous HTML tags and the new ones, leading to unexpected behavior. For example, the failing test in Workflow Run-3433337969 expects adocument
object without any button but one of the previousdescribe
block used two buttons that match one of the validations, so when the elements combine in thedocument
object the functions returns true instead of false.Possible Solution
keeping with the current approach in PacerSpec.js, We could insert this line above line 10:
document.body.innerHTML=''
This will make sure that the
body
of thedocument
object is clear before creating the main container of HTML tags for everydescribe
block.