Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
Angualr testing library fails with special character

In my testing if I use the special character it fails. I am doing the escape but still it fails, here is my test.

import { ReactiveFormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MaterialModule } from '@hf-workspace/material';
import { render, screen } from '@testing-library/angular';

import { FormAdduserComponent } from './form-add.component';

const formImports = [
  ReactiveFormsModule,
  BrowserAnimationsModule,
  MaterialModule,
];



it('should render the FormAdduserComponent', async () => {
  await render(FormAdduserComponent, {
    imports: formImports,
  });
});

it('should render the Form ', async () => {
  await render(FormAdduserComponent, {
    imports: formImports,
  });
  expect(screen.getByRole('form')).toBeInTheDocument();
});

it('should render all Form elements ', async () => {
  await render(FormAdduserComponent, {
    imports: formImports,
    componentProperties: { schema: schemaAddUser },
  });
  const x = 'Set AM/PM';
  expect(screen.getByLabelText(/Time Format/i)).toBeInTheDocument();
  expect(screen.getByLabelText(/Set Time/i)).toBeInTheDocument();
  expect(screen.getByLabelText(/Set AM\/\PM/i)).toBeInTheDocument();//fails
  expect(screen.getByLabelText(/Address1/i)).toBeInTheDocument();
  expect(screen.getByLabelText(/Address2/i)).toBeInTheDocument();
  expect(screen.getByLabelText(/Address3/i)).toBeInTheDocument();
  expect(screen.getByLabelText(/Country/i)).toBeInTheDocument();
  expect(screen.getByLabelText(/City/i)).toBeInTheDocument();
  expect(screen.getByLabelText(/State\/\Province/i)).toBeInTheDocument();//fails
});

how to use the special characters?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda