Skip to content

Problems with change detection and old version of testing-library #1342

Open
@mathisvester

Description

@mathisvester

The installed version of @testing-library/angular (v16.0.0) seems to be incompatible with @angular-devkit/core (v19.2.5). See Bug Fixes paragraph of this Release: https://github.com/testing-library/angular-testing-library/releases/tag/v17.3.4.

All deps of @testing-library should be upgraded to the latest stable version.

While trying to solve Real-life Application I encountered difficulties debugging change detection issues with the currently installed version.

For example this test taken from #926 doesn't work anymore, because change detection isn't triggered after calling userEvent.type(...). When installing the latest version, this code works again.

describe('Given Install inside the search input', () => {
    it('Then one row is visible', async () => {
      // Arrange
      await setup();
      expect((await screen.findAllByRole('listitem')).length).toBe(2);

      // Act
      await userEvent.type(
        screen.getByRole('textbox', { name: /search/i }),
        'Install',
      );

      // Assert
      expect(screen.getAllByRole('listitem').length).toBe(1);
    });
  });

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions