The friction force opposes the direction of the movement, not necessarily the weight's parallel component.
If the tension force is greater than the weight's parallel force the object will want to slide up the ramp and the friction force will be pointing opposite of the tension force along the ramp. The static friction force will try to hold the object stationary while growing up from zero gradually to the level needed fore dislodging the object. Then it will drop down to the kinetic friction. So the static friction is a transient force just before the object starts to move.
If the tension force is smaller than the weight's parallel component the object will want to move down and the friction force will be parallel to the tension. And same process as mentioned above will happen in reverse direction.