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

[Bug]: Another Immutable equals comparison failure #12860

Closed
pbomb opened this issue May 18, 2022 · 3 comments · Fixed by #12899
Closed

[Bug]: Another Immutable equals comparison failure #12860

pbomb opened this issue May 18, 2022 · 3 comments · Fixed by #12899

Comments

@pbomb
Copy link
Contributor

pbomb commented May 18, 2022

Version

28.1.0

Steps to reproduce

import Immutable from 'immutable';

it('works with immutable objects', () => {
  const a = Immutable.OrderedMap().set('saving', true);
  const b = Immutable.OrderedMap().merge({ saving: true });
  console.log(a);
  console.log(b);
  expect(Immutable.is(a, b)).toBe(true);
  expect(a).toEqual(b);
});

Expected behavior

The test should pass

Actual behavior

The isEqual test fails. The Immutable.is(a, b) assertion passes.

Additional context

This is possibly the same issue as #12752 that wasn't addressed in that fix. The call to merge sets an ownerID value on the _root property whereas the set call does not.

Environment

System:
    OS: macOS 12.4
    CPU: (10) x64 Apple M1 Pro
  Binaries:
    Node: 14.18.1 - /var/folders/b4/0jgrn8fx6vn5bd59pmybg6zw0000gn/T/fnm_multishells/4762_1652895535386/bin/node
    Yarn: 1.22.18 - ~/workspace/zenpayroll/node_modules/.bin/yarn
    npm: 8.3.1 - /opt/homebrew/bin/npm
  npmPackages:
    jest: ^28.1.0 => 28.1.0
@SimenB
Copy link
Member

SimenB commented May 20, 2022

PR welcome 😀

@SimenB
Copy link
Member

SimenB commented Jun 7, 2022

@github-actions
Copy link

github-actions bot commented Jul 8, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants