Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorJorgeFGA committed Aug 20, 2024
1 parent 4b3ee22 commit a797eac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/private/pages/editarRotina.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function EditarRotina() {
const [descricao, setDescricao] = useState(params.descricao);
const [categoria, setCategoria] = useState(params.categoria);
const [dias, setDias] = useState(
params.dias !== "" ? params.dias.split(",").map((dia) => Number(dia)) : [],
(params.dias !== "" && params.dias !== undefined) ? params.dias.split(",").map((dia) => Number(dia)) : [],
);
const [showLoading, setShowLoading] = useState(false);
const [erros, setErros] = useState<IErrors>({});
Expand Down Expand Up @@ -89,7 +89,7 @@ export default function EditarRotina() {
};

const handleErrors = () => {
const erros: IErrors = {};
let erros: IErrors = {};

if (!titulo) {
erros.titulo = "Campo obrigatório!";
Expand Down Expand Up @@ -300,7 +300,7 @@ export default function EditarRotina() {
inputMaskChange={(hora) => setHora(hora)}
/>
</View>
<View style={styles.erro} testID="Erro-data">
<View style={styles.erro} testID="Erro-hora">
<ErrorMessage show={showErrors} text={erros.hora} />
</View>

Expand Down

0 comments on commit a797eac

Please sign in to comment.