Add exception tests to ElementsTest