I would like to design chapter heading like this

I have written like this

\def\@makeschapterhead#1{%

\titleformat{\chapter}[frame]{\normalfont\huge\bfseries\color{elanblue}}
{\MakeUppercase{\chaptertitlename}\ \thechapter}{20pt}{\Huge\MakeUppercase}
\par\vspace*{270\p@}}
\makeatother


but the title looks like this

• Even though you got around this in your other question: questions here should come with a so-called minimal working example, i.e. a minimal compilable document that starts with \documentclass, ends with \end{document}, can be compiled and illustrates the issue. – marmot Feb 13 at 6:07

\documentclass{report}
\usepackage{titlesec}
\usepackage{xcolor}
\usepackage{lipsum}
\titleformat{\chapter}[display]{\filcenter\normalfont\huge\bfseries\sffamily\color{blue}}
{\large\color{black}\chaptertitlename~\thechapter}{8pt}{\Huge\MakeUppercase}
\begin{document}
\chapter{Test}
\lipsum[1]

\chapter{Another test}
\lipsum[2]
\end{document}