Hey!
So first things first: although the comma placement might be fundamentally correct, that's not the main issue here. The main issue here is the syntax.
If I chose to keep this sentence, I would actually use dashes for the phrase "If I remember right." It would read as such:
"I wanted to let you know because - if I remember right - I think I remember you saying we’ll be having a test tomorrow."
This flows better. Although it's just a simple change of punctuation, the dashes are creating emphasis on the phrase. You also could omit the phrase "I think" because it is a little redundant! You've already said "I think" using the phrase with the keyword remember. Ideally, without recreating the entire sentence, you might want to have this:
"I wanted to let you know because - if I remember correctly - I recall that you said we’ll be having/taking a test tomorrow."
Be careful about redundancy in word structure! Also, try to use active voice whenever possible. I hope this helped.
Edit: If you're ever unsure whether a phrase needs surrounding commas or not, take them out. If it reads like a run-on sentence (no pauses, breaks), you need commas/dashes!