|
1 | 1 | import pytest |
2 | 2 |
|
| 3 | +from idom.client.manage import web_module_url, web_module_exports, build, restore |
3 | 4 |
|
4 | | -from idom.client.manage import web_module_url, build, restore |
| 5 | +from tests.general_utils import assert_same_items |
5 | 6 |
|
6 | 7 |
|
7 | 8 | @pytest.fixture(scope="module", autouse=True) |
8 | 9 | def _setup_build_for_tests(): |
9 | | - build([{"source_name": "tests", "js_dependencies": ["jquery"]}]) |
| 10 | + build([{"source_name": "tests", "js_dependencies": ["victory@35.4.0"]}]) |
10 | 11 | try: |
11 | 12 | yield |
12 | 13 | finally: |
13 | 14 | restore() |
14 | 15 |
|
15 | 16 |
|
16 | 17 | def test_web_module_url(): |
17 | | - assert web_module_url("tests", "path/does/not/exist.js") is None |
18 | | - assert web_module_url("tests", "jquery") == "../web_modules/jquery-tests-56e1841.js" |
| 18 | + assert web_module_url("tests", "does/not/exist") is None |
| 19 | + assert ( |
| 20 | + web_module_url("tests", "victory") == "../web_modules/victory-tests-24fa38b.js" |
| 21 | + ) |
| 22 | + |
| 23 | + |
| 24 | +def test_web_module_exports(): |
| 25 | + assert web_module_exports("tests", "does/not/exist") == [] |
| 26 | + assert_same_items( |
| 27 | + web_module_exports("tests", "victory"), |
| 28 | + [ |
| 29 | + "Area", |
| 30 | + "Axis", |
| 31 | + "Background", |
| 32 | + "Bar", |
| 33 | + "Border", |
| 34 | + "Box", |
| 35 | + "BrushHelpers", |
| 36 | + "Candle", |
| 37 | + "Circle", |
| 38 | + "ClipPath", |
| 39 | + "Collection", |
| 40 | + "CursorHelpers", |
| 41 | + "Curve", |
| 42 | + "Data", |
| 43 | + "DefaultTransitions", |
| 44 | + "Domain", |
| 45 | + "ErrorBar", |
| 46 | + "Events", |
| 47 | + "Flyout", |
| 48 | + "Helpers", |
| 49 | + "LabelHelpers", |
| 50 | + "Line", |
| 51 | + "LineSegment", |
| 52 | + "Log", |
| 53 | + "Path", |
| 54 | + "Point", |
| 55 | + "Portal", |
| 56 | + "PropTypes", |
| 57 | + "RawZoomHelpers", |
| 58 | + "Rect", |
| 59 | + "Scale", |
| 60 | + "Selection", |
| 61 | + "SelectionHelpers", |
| 62 | + "Slice", |
| 63 | + "Style", |
| 64 | + "TSpan", |
| 65 | + "Text", |
| 66 | + "TextSize", |
| 67 | + "Transitions", |
| 68 | + "VictoryAnimation", |
| 69 | + "VictoryArea", |
| 70 | + "VictoryAxis", |
| 71 | + "VictoryBar", |
| 72 | + "VictoryBoxPlot", |
| 73 | + "VictoryBrushContainer", |
| 74 | + "VictoryBrushLine", |
| 75 | + "VictoryCandlestick", |
| 76 | + "VictoryChart", |
| 77 | + "VictoryClipContainer", |
| 78 | + "VictoryContainer", |
| 79 | + "VictoryCursorContainer", |
| 80 | + "VictoryErrorBar", |
| 81 | + "VictoryGroup", |
| 82 | + "VictoryHistogram", |
| 83 | + "VictoryLabel", |
| 84 | + "VictoryLegend", |
| 85 | + "VictoryLine", |
| 86 | + "VictoryPie", |
| 87 | + "VictoryPolarAxis", |
| 88 | + "VictoryPortal", |
| 89 | + "VictoryScatter", |
| 90 | + "VictorySelectionContainer", |
| 91 | + "VictorySharedEvents", |
| 92 | + "VictoryStack", |
| 93 | + "VictoryTheme", |
| 94 | + "VictoryTooltip", |
| 95 | + "VictoryTransition", |
| 96 | + "VictoryVoronoi", |
| 97 | + "VictoryVoronoiContainer", |
| 98 | + "VictoryZoomContainer", |
| 99 | + "Voronoi", |
| 100 | + "VoronoiHelpers", |
| 101 | + "Whisker", |
| 102 | + "Wrapper", |
| 103 | + "ZoomHelpers", |
| 104 | + "addEvents", |
| 105 | + "brushContainerMixin", |
| 106 | + "combineContainerMixins", |
| 107 | + "createContainer", |
| 108 | + "cursorContainerMixin", |
| 109 | + "makeCreateContainerFunction", |
| 110 | + "selectionContainerMixin", |
| 111 | + "voronoiContainerMixin", |
| 112 | + "zoomContainerMixin", |
| 113 | + ], |
| 114 | + ) |
0 commit comments