It depends on where the water came from and how long it had been leaking. The Texas Department of Insurance gives some clear rules of thumb, and a few habits after a leak protect your claim.
The Texas Department of Insurance says most homeowners and renters policies cover water damage that is sudden and accidental. A supply line that splits under the sink, a washing machine hose that bursts, or a pipe that freezes and cracks are typical examples. The damage happened all at once and was not something you could have seen coming.
Gradual leaks are a different story. A drip behind the dishwasher that rotted the subfloor over months, or a shower pan that slowly seeped into the wall, is usually not covered, according to TDI. Your own policy wording is what controls, so read it or call your agent when you are unsure.