Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All input components throw error in tests #1612

Closed
2 tasks done
charlesp-siemens opened this issue Dec 9, 2024 · 1 comment
Closed
2 tasks done

All input components throw error in tests #1612

charlesp-siemens opened this issue Dec 9, 2024 · 1 comment

Comments

@charlesp-siemens
Copy link

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

What happened?

Any test (using Jest) that contains an IxInput, IxNumberInput, or IxSelect throws an error immediately upon rendering. The format of the error is shown below. I have also attached the console log output of running the below code to reproduce the issue.

ix_2.6.1_input_errors.txt

Error: Uncaught [TypeError: this.attachInternals is not a function]

We have also downloaded and used the latest version of the iX 'main' branch to test with (the in-progress version 2.6.1) to see if the latest bug fixes resolve this issue - but they do not.

What type of frontend framework are you seeing the problem on?

React

Which version of iX do you use?

2.6.0

Code to produce this issue.

import { IxApplicationContext, IxInput, IxNumberInput, IxSelect } from '@siemens/ix-react';
import { render } from '@testing-library/react';

describe('iX 2.6.1 input / select error test', () => {
  test('test IxInput component to see if it still throws a typeException', () => {
    render(
      <IxApplicationContext>
        <IxInput />
      </IxApplicationContext>,
    );
  });

  test('test IxNumberInput component to see if it still throws a typeException', () => {
    render(
      <IxApplicationContext>
        <IxNumberInput />
      </IxApplicationContext>,
    );
  });

  test('test IxSelect component to see if it still throws a typeException', () => {
    render(
      <IxApplicationContext>
        <IxSelect />
      </IxApplicationContext>,
    );
  });
});
@charlesp-siemens charlesp-siemens added the triage We discuss this topic in our internal weekly label Dec 9, 2024
@danielleroux
Copy link
Collaborator

danielleroux commented Dec 9, 2024

This is not an issue of ix, your testing environment does simply not support the latest html standards you have to update it or apply a polyfill during test setup (e.g https://www.npmjs.com/package/element-internals-polyfill).

@danielleroux danielleroux removed the triage We discuss this topic in our internal weekly label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants