You should assert that the element span#dates exist and its count is 1.
test for me.
The method you should be using is elements not element.
The former takes a count argument because there can be elements (plural) but the latter can not as it is only an element it is looking for so a count argument doesn’t make sense.