.Params.categories is a string array or an array of strings if you will []string{"Test"} and not a string string.
In order to lower all the items in your array, you can use apply which runs a given function on items in an array and returns the array with the returned values.
{{ $lower_categories := apply .Params.categories "lower" }}
{{ if (in $lower_categories (lower "TEST")) }}
[...]
{{ end }}
Sure. Well before calling apply it seems you need to make sure your array is not empty.
You can set a default empty array and overwrite if with succeeds.
{{ $lower_categories := slice }}
{{ with .Params.categories }}
{{ $lower_categories := apply . "lower" }}
{{ end }}
{{ if (in $lower_categories (lower "TEST")) }}
[...]
{{ end }}