Skip to content

Some style colors ignored #214

Closed
Closed
@PavelPZ

Description

@PavelPZ

I am using react-testing-library 5.2.3 with JEST 23.6.0 and REACT 16.7.0-alpha.0.

I have problem with this code...

describe("COLR PROBLEM", () => {
  let comp = render(<div style={{ color: 'lightblue', backgroundColor: 'blue' }} />)
  let { color, backgroundColor } = (comp.container.firstElementChild as HTMLElement).style
  comp = render(<div style={{ color: 'blue', backgroundColor: 'lightblue' }} />)
  let { color: color2, backgroundColor: backgroundColor2 } = (comp.container.firstElementChild as HTMLElement).style
  console.log({ color, backgroundColor, color2,  backgroundColor2 })
})

which logs following:
Object {color: "", backgroundColor: "blue", color2: "blue", backgroundColor2: ""}

It seems that colors other than basic one (with light or dark prefix) are ignored.

Colors is lost during

_reactDom.default.render(ui, container);

at line 51 in node_modules\react-testing-library\dist\index.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions