I'm trying to create a custom environment called `graph` and underline the label before the colon. This is what I have:

```
\documentclass{article}

\usepackage{caption}
\usepackage{float}
\usepackage{ulem}

\floatstyle{plaintop}
\newfloat{graph}{tbph}{log}
\floatname{graph}{Graph}

\DeclareCaptionLabelFormat{test}{\uline{#1 #2}}
\captionsetup[graph]{labelformat=test}

\begin{document}
    \begin{graph}[h]
    \caption{Testing}
    \end{graph}
\end{document}

```

The problem is that the float name "Graph" completely disappears and I'm left with " 1: Testing". How do I resolve this issue?