# Why no degrees of freedom for Z test

I am reading about hypothesis testing and have encountered Z test and T test. I have understood both the tests and their usage. One part that is not still clear is why does Z test does not depend on Degrees of freedom where as other tests like T test, chi-square depend on degrees of freedom.

For example on the graph below you can see comparison of students t distribution for t-test and standard normal distribution for z-test for 3 cases where number of observations is $$n=2,5,8$$ respectively.
In all three cases the z-test will just use the same standard normal distribution, but in the case of t-test the shape of t-distribution changes with number of observations and consequently degrees of freedom (for simple one sample t-test degrees of freedom are $$df=n-1$$.)