OP - I'm not quite in the same situation, but this is something that has been playing on my mind for a while.
I've been TTC for a year now, and hated my previous role (I kept going, as I was hoping to be able to fall pregnant, leave on maternity and then look for a new role to start when my maternity leave finished. Great plan in an ideal world ...).
Few months back I decides to start looking for a new job. It's taking me a long time to conceive, and I realised I couldn't put my life for hold, for something that may not happen for many more months/years. When applying for jobs, I was terrified of falling pregnant and having to tell the new job as soon as I started.
Still not pregnant, but started my new role last week. The anxiety of falling pregnant so soon is still at back of my mind (however, I'm not going to put off trying as we do want a baby and are struggling to conceive).
My fears were eased when I met our HR manager learliwr this week - she's currently on maternity leave, and came in for one of her KIT days. During the conversation with her, she mentioned that she'd been the company for a while, and had been offered the promotion to manager whilst pregnant. Her cover (let's call her Person B) is doing a fantastic job, and so has also been offered a permanent position in the company - essentially, person B will now become the HR assistan, but has also been given another role alongside that, so that she can continue in a slightly managerial position, and with her current pay. Person B has been offered this permanent position whilst being 6 months pregnant herself.
YANBU - companies will manage to continue without you for a few months, whilst you take your maternity. No way should a woman ever be penalised from a new role/promotion, due to her pregnancy, if they are the right person for the job. If someone ever is - this is discrimination.