|
@@ -121,7 +121,6 @@ def test_compile_stylesheets(tmp_path, mocker):
|
|
|
assets_dir.mkdir()
|
|
|
|
|
|
(assets_dir / "styles.css").touch()
|
|
|
-
|
|
|
mocker.patch("reflex.compiler.compiler.Path.cwd", return_value=project)
|
|
|
|
|
|
stylesheets = [
|
|
@@ -141,6 +140,36 @@ def test_compile_stylesheets(tmp_path, mocker):
|
|
|
)
|
|
|
|
|
|
|
|
|
+def test_compile_stylesheets_exclude_tailwind(tmp_path, mocker):
|
|
|
+ """Test that Tailwind is excluded if tailwind config is explicitly set to None.
|
|
|
+
|
|
|
+ Args:
|
|
|
+ tmp_path: The test directory.
|
|
|
+ mocker: Pytest mocker object.
|
|
|
+ """
|
|
|
+ project = tmp_path / "test_project"
|
|
|
+ project.mkdir()
|
|
|
+
|
|
|
+ assets_dir = project / "assets"
|
|
|
+ assets_dir.mkdir()
|
|
|
+ mock = mocker.Mock()
|
|
|
+
|
|
|
+ mocker.patch.object(mock, "tailwind", None)
|
|
|
+ mocker.patch("reflex.compiler.compiler.get_config", return_value=mock)
|
|
|
+
|
|
|
+ (assets_dir / "styles.css").touch()
|
|
|
+ mocker.patch("reflex.compiler.compiler.Path.cwd", return_value=project)
|
|
|
+
|
|
|
+ stylesheets = [
|
|
|
+ "/styles.css",
|
|
|
+ ]
|
|
|
+
|
|
|
+ assert compiler.compile_root_stylesheet(stylesheets) == (
|
|
|
+ os.path.join(".web", "styles", "styles.css"),
|
|
|
+ "@import url('@/styles.css'); \n",
|
|
|
+ )
|
|
|
+
|
|
|
+
|
|
|
def test_compile_nonexistent_stylesheet(tmp_path, mocker):
|
|
|
"""Test that an error is thrown for non-existent stylesheets.
|
|
|
|