Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

417
Vistas
Method props is meant to be run on 1 node, 0 found instead (Jest, ReactJS)

Stuck what the best way is to do a unit testing on a Hook that checks if there is a matching character between input text and text of api. Only the NOT matching letter will be bold and the matching letter will stay normal. How do I test element that are only showing when typing more than 2 characters. This is basically a dropdown menu.

  return (
    <SearchResultComponent>
      {(loadingData && currentInputLength) ?
        <SearchResultBlockShow>
          {getResult.map((item: SearchTerm, index: number) => (
            <SearchResultBlock key={index} >
              <MakeBold currentResult={item.searchterm} keyword={currentInput} />
              <SearchResultSpan>{"(" + item.nrResults + ")"}</SearchResultSpan>
            </SearchResultBlock>
          ))} </SearchResultBlockShow> : <SearchNoResult>No Result</SearchNoResult>}

    </SearchResultComponent>
  )

][1]]2

import { mount, shallow } from "enzyme";
import { Provider } from "react-redux";
import { screen } from "@testing-library/dom";
import { render } from "@testing-library/react";
import '@testing-library/jest-dom';
import { store } from "../Store";
import { MakeBold } from "./matchCharacter";

it("SearchResult Component test props", () => {
    const wrap = shallow(
        <Provider store={store}>
            <MakeBold currentResult={"trui"} keyword={"trui"} />
        </Provider>
    );

    expect(
        wrap.find({ "data-testid": "match-character-test" }).
            filter((x: any) => x.props('dangerouslySetInnerHTML')).
            prop('dangerouslySetInnerHTML').
            __html
    ).toBe('<span>trui<span>');

});

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda