First level of documentation would be specifications. Which can then be used to write tests.
But in many, many shops "Agile" means "we don't do specs anymore, woohoo!".