A stock rally fueled in part by artificial intelligence is being tested after Democrats’ landslide election victories.