file descriptor test command

Can someone delve more into what below test command do?

if [ "$1" = "-t" ]; then

I know -t is for file descriptor

-t [FD]
file descriptor FD (stdout by default) is opened on a terminal

But not sure how to relate to it..

$1 is supposedly first argument, so let's say if

scriptname: doit
firstargument: file1

and if ./doit file1

then,

above test command is checking to see ...? (My guess would be if file1 file is already open on terminal?

can someone advise?

thanks

You are confusing two different things. First,
if [ "$1" = "-t" ]; then
is asking if the first argument to this script is "-t" or not. If it is "-t", that would mean whatever the author of the script intended it to mean. It might mean "output a total line" or it might mean something else entirely. It may or may not have anything to do with the built-in file descriptor test. But to discuss that test, it would go something like:
if [ -t ] ; then
This test requires the single bracket form of test. The newer [[ does not handle this test. We are asking if stdout is connected to a terminal. Or to put it another way, are we being run interactively? If we are interactive, we can pose a question and request an answer. A cron job cannot interact with a user like that.

An example of a command that behaves differently when interactive is "ls".
Just plain:
ls
will, on many systems, produce multi-column output while something like:
ls | cat
will produce single column output. Behavior like this is a little bit controversial, but some program do it anyway.

Looks like I did confuse myself ..

when running with -t option, script does run with TEST in the front.. I guess author wanted to run it in test mode if -t argument was given..
thanks.