The comma has a special meaning in the hx-trigger attrib. Maybe try escaping the selector by putting it in parens: hx-trigger="click from:(.test1, .test2)"
Just to write down the answer from a comment under the original question.
Also from the HTMX website - https://htmx.org/attributes/hx-trigger/
In order to pass a CSS selector that contains whitespace (e.g. form input) to the from- or target-modifier, surround the selector in parentheses or curly brackets (e.g. from:(form input) or from:closest (form input))