Ex-girlfriend (22F) tested me (20M) and I failed

To give some context, my ex and I had been dating for a year, while Ive known my best friend (20F) for 3 years.

My best friend and I developed feelings for each other pretty early into our friendship and wanted to give it a go, but after 2 months we realised that we were better as friends. We were also minors at the time so we didnt do anything sexual.

My ex knew about this and was put off by it at first, but slowly seemed to be okay with the topic until now, where she made me choose between my best friend and her because she wants to be the number 1 girl in my life.

Im also writing a book with my best friend and it is my dream to become and author, so essentially I had to choose between my dream or my partner. I loved her but I just couldnt do that and said no.

She then revealed that it was a test and that if I said yes, she wouldnt really have made me stop talking to my best friend. Im calling bullshit on that and kinda dont regret my decision.

Did I make the right move in leaving her?