The test-fire poses a test for Donald Trump, who has vowed to scrap a pivotal 2015 nuclear agreement with Iran.