Skip to content

Commit

Permalink
test: solara needs to recreate the import map widget
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Feb 6, 2024
1 parent a277d3d commit 44e69df
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ And it also means we can copy paste _most_ of the examples from [mui](https://mu

```tsx
%%react -n my_widget -d
import Button from "@mui/material/Button";
import {Button} from "@mui/material";
import confetti from "canvas-confetti";
import * as React from "react";

Expand Down
2 changes: 1 addition & 1 deletion ipyreact/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Button from "@mui/material/Button";
import { Button } from "@mui/material";
import confetti from "canvas-confetti";

import * as React from "react";
Expand Down
2 changes: 1 addition & 1 deletion ipyreact/cellmagic.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def react(self, line, cell, local_ns):
Example:
%%react -n my_widget -d
import Button from '@mui/material/Button';
import {Button} from '@mui/material';
import confetti from "canvas-confetti";
import * as React from "react";
Expand Down
10 changes: 7 additions & 3 deletions tests/ui/library_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import playwright.sync_api
from IPython.display import display

import ipyreact

code = """
import Button from '@mui/material/Button';
import {Button} from '@mui/material';
import * as React from "react";
export default function({value, setValue, debug}) {
Expand All @@ -16,6 +14,12 @@


def test_material_ui(solara_test, assert_solara_snapshot, page_session: playwright.sync_api.Page):
# this can be removed if solara adds support to ipyreact/ipyesm
import ipyreact.importmap

ipyreact.importmap._import_map_widget = None
ipyreact.importmap._update_import_map()

class Button(ipyreact.ReactWidget):
_esm = code

Expand Down

0 comments on commit 44e69df

Please sign in to comment.