Two conditions are required for TIR:
light must be travelling from a material with a higher refractive index to a material with a lower refractive index
Angle of incidence of the ray to the normal must be above the critical angle
If the incidence angle = Critical angle, then light refracts along the boundary between the 2 media