Try the following 3 lines in bash:
if [ "a" == "a" ]; then echo hi; fi
if ["a" == "a" ]; then echo hi; fi
if ["a" == "a"]; then echo hi; fi
You’ll see that only the first one works, whereas the other two do not. i.e. it’s your lack of spaces is the reason why your expression doesn’t work.
The above example also suggests that you can test out bash syntax directly on the bash prompt. You can get it right before incorporating them into your script.