Assalamu alaikum!

If a Muslim woman had an unlawful sexual relation with her future husband, I know she must wait one menstrual cycle before marrying, to assure she's not pregnant.
My question is: if the woman has very irregular periods (sometimes it passes 3 months without getting it!), is it permissible for her to just take a pregnancy test to make sure she isn't pregnant?

Thanks in advance!