Democrat Abigail Spanberger has defeated Republican Winsome Earle-Sears in the Virginia gubernatorial race, a contest widely seen as a test for US President Donald Trump's leadership and the Republican Party’s national standing.