I was wondering if someone whose parent is mentally ill tends to seek out partners/spouses who are mentally ill?
No doubt! It has happened to me.
My father was a malignant alcoholic. Likely a narcissist, as well. My mother was his codependent and enabler.
My first girlfriend, as a teenager, was dysfunctional and had a dysfunctional family, as well. She tried to trick me into getting her pregnant by lying about taking birth control pills. She actually had the pills but, instead of taking them, she was flushing them down the toilet (or something) each day. I found out what she was up to and we broke up before it was too late. However, she pulled the same stunt on her next boyfriend and he did get her pregnant. She got her just desserts, though. The guy flew the coop and left her high and dry. I feel sorry for her but I can't say I don't feel a tiny bit of Schadenfreude, every now and again.
My second girlfriend was bipolar or something. It doesn't really matter, though. I haven't seen her for decades. It wasn't exactly an amicable breakup but we broke contact and never saw each other. Did I break up with her or did she break up with me? I guess it depends on who you ask.

My wife...now ex-wife...is Borderline. (Now known as "Emotional Instability Disorder.") She's also delusional. She talks to Teddy Bears like they are real. That's only the tip of the iceberg. There's a lot more that I can't talk about in a public forum. Let's just say things could have ended badly for me if I hadn't gotten out when I did. It was quite the acrimonious divorce! If you've heard the term, "Walking on Eggshells," my entire marriage was like that...on steroids! I can't say I miss her.
The thing is that it seems like every one of them picked me. The majority of girls I liked in high school always seemed to be unavailable. The ones that weren't were aloof. If I had been able to go out with any of them, I wouldn't have been able to bring them home to my family, anyhow. With a severely alcoholic father and, with the rest of my family being dysfunctional, there would have been no way to have a good relationship. There was a lot more going on that I can't talk about but let's just say that, because of the way things were, all the girls I wanted to date in school were out of reach.
The popular term that I hear, a lot, is "Magnet Syndrome." People from dysfunctional backgrounds often seem to attract dysfunctional mates whether they are diagnosably dysfuntional, themselves, or not.
I can't say that it's a true phenomenon for other people but I can definitely say that it's true for me.
Is it true for you? Talk to your therapist or clergy and decide for yourself to be sure but, IMO, regardless of whether you receive counseling, you still need to spend some time with yourself in true self-contemplation and go with your gut.