aboutsummaryrefslogtreecommitdiff
path: root/integration/snippets/custom-emotion-jsx/file.jsx
blob: c00cb0543591f092e8c7bdefeee38e8a1bc22935 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import * as ReactDOM from "react-dom";
export const Foo = () => <div css={{ content: '"it worked!"' }}></div>;

export function test() {
  const element = document.createElement("div");
  element.id = "custom-emotion-jsx";
  document.body.appendChild(element);
  ReactDOM.render(<Foo />, element);
  const style = window.getComputedStyle(element.firstChild);
  if (!(style["content"] ?? "").includes("it worked!")) {
    throw new Error('Expected "it worked!" but received: ' + style["content"]);
  }

  return testDone(import.meta.url);
}