This. Just yesterday, I was asked by an interviewer at a Startup. "How do you test your code? Do you write tests? What's your familiarity with TDD."
My answer: "I prefer to do a test driven approach. However, none of the companies I worked for allocated time for writing tests in the sprint, so I have not been able to actually do this in practice. I usually debug my code and run it through all the happy path and edge cases."
Was bitten once very early in my career just like OP, and decided to only write tests after initial coding, if there was time left. Most (not all) Companies expect you to do TDD, but never allocate time for it in the estimation. So I've made it a point to ask the PM if there was time allowed for writing tests in the estimate, and if they say something like "Oh no we don't have time for that" I don't do it.