Since you are in your 40s, I’m going to guess that your wife is as well. For that reason, the first stop is with her doctor and perhaps an endocrinologist. You didn’t mention whether your wife’s episodes correlate in any way with her menstrual cycle. It’s possible that she is perimenopausal and that her mood shifts are related. It’s important to establish whether or not that is the case before concluding there is a mental health problem.
I understand and appreciate that you’ve been trying to be helpful by investigating possibilities on line. But no matter how sophisticated an online test may seem, it does not compare to seeing someone who has 7 or more years of schooling and many years of experience as a mental health professional. If the problem were simple, you would have easily found an answer. Since you didn’t, it’s time to see a professional.
If she is medically fine, encourage your wife to make an appointment with a psychiatrist or psychologist. I hope she’ll let you go with her since you are able to observe from the outside what she is experiencing inside. Take as much information to that appointment as you can. (It would be helpful if you tracked the mood shifts for a few months and made notes about onset, behaviors, and when she gets back to her usual self.)
You are both suffering. There is help available. Your letter shows me that your motivation is there. I hope you and your wife can work as a team to figure out what is going on and to follow recommendations that may relieve you both.
I wish you well.