repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
reflex | docs/app/reflex_docs/pages/docs/__init__.py | .py | import os
import re
from collections import defaultdict, namedtuple
from functools import lru_cache
from pathlib import Path
from types import SimpleNamespace
import reflex as rx
from reflex_components_core.core.cond import Cond
from reflex_docgen.markdown import FrontMatter, parse_document
# External Components
from... | 587 | 22,869 |
reflex | docs/app/reflex_docs/pages/docs/enterprise.py | .py | """The enterprise documentation pages."""
from reflex_docs.templates.docpage import docpage
@docpage(
set_path="/enterprise/overview",
t="Overview | Enterprise",
)
def overview():
"""The enterprise overview page."""
pass
| 13 | 240 |
reflex | docs/app/reflex_docs/pages/docs/component.py | .py | """Utility functions for the component docs page."""
import hashlib
import os
import re
import textwrap
from pathlib import Path
from types import UnionType
from typing import Literal, Union, _GenericAlias, get_args, get_origin
import reflex as rx
import reflex_components_internal as ui
from reflex.components.base.fr... | 1,047 | 37,971 |
reflex | docs/app/reflex_docs/pages/docs/source.py | .py | import itertools
from collections.abc import Callable, Sequence
import reflex as rx
from reflex_docgen import (
FieldDocumentation,
MethodDocumentation,
generate_class_documentation,
)
from reflex_docs.docgen_pipeline import render_markdown
from reflex_docs.templates.docpage import h1_comp, h2_comp
table... | 213 | 6,911 |
reflex | docs/app/reflex_docs/pages/docs/recipes_overview.py | .py | import reflex as rx
from reflex_docs.templates.docpage import docpage, h1_comp, h2_comp, text_comp_2
def get_component_link(category, clist) -> str:
file_name_without_extension = clist.split("/")[-1].split(".")[0].replace("_", "-")
return f"/recipes/{category}/{file_name_without_extension}"
def format_titl... | 112 | 3,707 |
reflex | docs/app/reflex_docs/pages/docs/guide.py | .py | import reflex as rx
from reflex_site_shared.templates.webpage import webpage
@webpage(path="/flexdown-guide", title="Flexdown Guide")
def guide():
return rx.box("Coming Soon")
| 8 | 182 |
reflex | docs/app/reflex_docs/pages/docs/api_reference/utils.py | .py | """Utils API reference page."""
import reflex as rx
from reflex_docs.templates.docpage import docpage
@docpage("/api-reference/utils/")
def utils():
"""Utils API reference page."""
with open("docs/api-reference/utils.md", encoding="utf-8") as f:
content = f.read()
return rx.markdown(content)
| 14 | 317 |
reflex | docs/app/reflex_docs/pages/docs/api_reference/plugins.py | .py | """Plugins API reference page."""
import reflex as rx
from reflex_docs.templates.docpage import docpage
@docpage("/api-reference/plugins/")
def plugins():
"""Plugins API reference page."""
with open("docs/api-reference/plugins.md", encoding="utf-8") as f:
content = f.read()
return rx.markdown(co... | 14 | 327 |
reflex | docs/app/reflex_docs/pages/docs_landing/__init__.py | .py | import reflex as rx
from reflex_site_shared.constants import REFLEX_ASSETS_CDN
from reflex_site_shared.meta.meta import create_meta_tags
from reflex_site_shared.views.cta_card import cta_card
from reflex_site_shared.views.footer import footer_index
from reflex_docs.pages.docs_landing.views import (
ai_builder_sect... | 58 | 2,096 |
reflex | docs/app/reflex_docs/pages/docs_landing/views/hosting.py | .py | import reflex as rx
from reflex_docs.pages.docs import hosting as hosting_page
from reflex_docs.pages.docs_landing.views.link_item import faded_borders, link_item
def hosting_section() -> rx.Component:
return rx.el.section(
rx.el.div(
rx.el.h2(
"Cloud",
class_n... | 52 | 2,182 |
reflex | docs/app/reflex_docs/pages/docs_landing/views/self_hosting.py | .py | import reflex as rx
from reflex_docs.pages.docs import hosting as hosting_page
from reflex_docs.pages.docs_landing.views.link_item import faded_borders, link_item
def self_hosting_section() -> rx.Component:
return rx.el.section(
rx.el.div(
rx.el.h2(
"Self-Hosting",
... | 39 | 1,517 |
reflex | docs/app/reflex_docs/pages/docs_landing/views/__init__.py | .py | from .ai_builder import ai_builder_section
from .divider import divider
from .enterprise import enterprise_section
from .framework import framework
from .hero import hero
from .hosting import hosting_section
from .link_item import link_item
from .other import other_section
from .self_hosting import self_hosting_section... | 22 | 521 |
reflex | docs/app/reflex_docs/pages/docs_landing/views/enterprise.py | .py | import reflex as rx
from reflex_docs.pages.docs import enterprise as enterprise_page
from reflex_docs.pages.docs_landing.views.link_item import faded_borders, link_item
def enterprise_section() -> rx.Component:
return rx.el.section(
rx.el.div(
rx.el.h2(
"Enterprise",
... | 39 | 1,685 |
reflex | docs/app/reflex_docs/pages/docs_landing/views/ai_builder.py | .py | import os
import frontmatter
import reflex as rx
import reflex_components_internal as ui
from reflex_site_shared.components.marquee import marquee
from reflex_site_shared.constants import REFLEX_ASSETS_CDN
from reflex_site_shared.integrations import get_integration_logo_url
from reflex_docs.pages.docs import ai_build... | 193 | 7,396 |
reflex | docs/app/reflex_docs/pages/docs_landing/views/link_item.py | .py | import reflex as rx
import reflex_components_internal as ui
def faded_borders() -> rx.Component:
return rx.fragment(
rx.el.div(
class_name="absolute bottom-0 -left-24 w-24 h-px bg-gradient-to-r from-transparent to-current text-secondary-4"
),
rx.el.div(
class_name="... | 52 | 2,052 |
reflex | docs/app/reflex_docs/pages/docs_landing/views/hero.py | .py | import reflex as rx
import reflex_components_internal as ui
from reflex_site_shared.components.marketing_button import button
from reflex_site_shared.constants import REFLEX_ASSETS_CDN
from reflex_site_shared.views.hosting_banner import HostingBannerState
from reflex_docs.pages.docs import getting_started
def hero()... | 67 | 2,526 |
reflex | docs/app/reflex_docs/pages/docs_landing/views/divider.py | .py | import reflex as rx
import reflex_components_internal as ui
def divider(class_name: str = "") -> rx.Component:
return rx.el.div(
rx.el.div(
class_name="absolute top-0 -right-24 w-24 h-px bg-gradient-to-l from-transparent to-current text-secondary-4"
),
rx.el.div(
cl... | 18 | 602 |
reflex | docs/app/reflex_docs/pages/docs_landing/views/other.py | .py | import reflex as rx
from reflex_site_shared.constants import CONTRIBUTING_URL
from reflex_docs.pages.docs.custom_components import custom_components
from reflex_docs.pages.docs_landing.views.link_item import faded_borders, link_item
def other_section() -> rx.Component:
return rx.el.section(
rx.el.div(
... | 40 | 1,683 |
reflex | docs/app/reflex_docs/pages/docs_landing/views/framework.py | .py | import reflex as rx
import reflex_components_internal as ui
from reflex_site_shared.components.marketing_button import button
from reflex_site_shared.constants import REFLEX_ASSETS_CDN
from reflex_docs.pages.docs import database, enterprise, getting_started
from reflex_docs.pages.docs.library import library
from refle... | 192 | 7,757 |
reflex | docs/app/reflex_docs/pages/integrations/integration_gallery.py | .py | import reflex as rx
import reflex_components_internal as ui
from reflex.experimental import ClientStateVar
from reflex_site_shared.integrations import get_integration_logo_url
from .integration_list import get_integration_path
from .integration_request import request_integration_dialog
selected_filter = ClientStateVa... | 123 | 4,416 |
reflex | docs/app/reflex_docs/pages/integrations/integration_header.py | .py | import reflex as rx
def integration_header() -> rx.Component:
return rx.el.section(
rx.el.h1(
"Integrations",
class_name="max-w-full inline-block bg-clip-text bg-gradient-to-r from-secondary-12 to-secondary-11 w-full font-xx-large text-center text-transparent text-balance mx-auto b... | 17 | 807 |
reflex | docs/app/reflex_docs/pages/integrations/integration.py | .py | import reflex as rx
from .integration_gallery import (
integration_filters,
integration_gallery,
integration_request_form,
)
from .integration_header import integration_header
# @mainpage(path="/integrations", title="Reflex · Integrations", meta=meta_tags)
def integration_page():
return rx.el.div(
... | 20 | 527 |
reflex | docs/app/reflex_docs/pages/integrations/integration_list.py | .py | import os
import frontmatter
# Get the paths for our integrations from the source docs/
def get_integration_path() -> list:
from integrations_docs import DOCS_DIR
base_dir = str(DOCS_DIR)
web_path_prefix = "/ai/integrations"
result = []
exclude_files = [
"mcp_installation",
"mcp... | 61 | 1,729 |
reflex | docs/app/reflex_docs/pages/integrations/integration_request.py | .py | import reflex as rx
import reflex_components_internal as ui
from reflex_docs.templates.docpage.feedback_state import FeedbackState
def request_integration_dialog() -> rx.Component:
return ui.dialog(
title="Request Integration",
description="Let us know what integration you'd like to see added.",
... | 39 | 1,231 |
reflex | docs/app/reflex_docs/utils/http.py | .py | """HTTP client utilities."""
from collections.abc import Callable
from functools import wraps
from typing import TypeVar
import aiohttp
import orjson
T = TypeVar("T")
def once(f: Callable[[], T]) -> Callable[[], T]:
"""A decorator that calls the function once and caches the result.
Args:
f: The fu... | 49 | 1,052 |
reflex | docs/app/reflex_docs/components/button.py | .py | from typing import Callable, Literal
import reflex as rx
from reflex_site_shared.components.icons import get_icon
LiteralButtonVariant = Literal[
"primary", "success", "destructive", "secondary", "muted"
]
default_class_name = "text-sm font-semibold rounded-xl cursor-pointer inline-flex items-center justify-cent... | 87 | 2,281 |
reflex | docs/app/reflex_docs/components/hint.py | .py | import reflex as rx
def hint(
text: str,
content: rx.Component,
side: str = "top",
align: str = "center",
active: bool = False,
class_name: str = "",
**props,
) -> rx.Component:
return rx.hover_card.root(
rx.hover_card.trigger(content, height="fit-content"),
rx.hover_ca... | 27 | 672 |
reflex | docs/app/reflex_docs/components/docpage/navbar/buttons/sidebar.py | .py | """Navbar sidebar buttons, reusing the shared marketing-site drawer."""
from reflex_site_shared.views.sidebar import docs_sidebar_drawer, navbar_sidebar_button
__all__ = ["docs_sidebar_drawer", "navbar_sidebar_button"]
| 6 | 221 |
reflex | docs/app/reflex_docs/templates/docpage/state.py | .py | """The state for the navbar component."""
import reflex as rx
class NavbarState(rx.State):
"""The state for the navbar component."""
# Whether the sidebar is open.
sidebar_open: bool = False
search_input: str = ""
enter: bool = False
banner: bool = True
ai_chat: bool = True
curr... | 37 | 728 |
reflex | docs/app/reflex_docs/templates/docpage/feedback_state.py | .py | """The state for the navbar component."""
import contextlib
from typing import Optional
import httpx
import reflex as rx
from httpx import Response
from reflex_site_shared.constants import (
REFLEX_DEV_WEB_GENERAL_FORM_FEEDBACK_WEBHOOK_URL,
)
class FeedbackState(rx.State):
"""The state for feedback componen... | 131 | 4,017 |
reflex | docs/app/reflex_docs/templates/docpage/docpage.py | .py | """Template for documentation pages."""
import functools
from collections.abc import Callable, Collection
import reflex as rx
import reflex_components_internal as ui
from reflex.components.radix.themes.base import LiteralAccentColor
from reflex.experimental.client_state import ClientStateVar
from reflex.utils.format ... | 723 | 27,879 |
reflex | docs/app/reflex_docs/templates/docpage/sidebar/state.py | .py | """The state of the sidebar component."""
from __future__ import annotations
from dataclasses import dataclass, field
@dataclass(kw_only=True)
class SideBarBase:
"""Base class for the Side bar."""
# The name to display in the sidebar.
names: str = ""
alt_name_for_next_prev: str = ""
# The lin... | 47 | 1,227 |
reflex | docs/app/reflex_docs/templates/docpage/sidebar/sidebar.py | .py | """Logic for the sidebar component."""
from __future__ import annotations
import reflex as rx
from reflex_site_shared.components.docs_shell import (
docs_sidebar_category as sidebar_category,
)
from reflex_site_shared.components.docs_shell import (
docs_sidebar_group,
docs_sidebar_section,
)
from reflex_s... | 664 | 21,875 |
reflex | docs/app/reflex_docs/templates/docpage/sidebar/sidebar_items/item.py | .py | import re
from reflex_site_shared.route import Route
from ..state import SideBarItem
def create_item(route: Route, children=None):
"""Create a sidebar item from a route."""
if children is None:
name = route.title
url = route.path
# For "Overview", we want to keep the qualifier prefix... | 37 | 1,033 |
reflex | docs/app/reflex_docs/templates/docpage/sidebar/sidebar_items/learn.py | .py | from reflex_docs.pages.docs import cloud_cliref
from .item import create_item
def get_sidebar_items_learn():
from reflex_docs.pages.docs import advanced_onboarding, getting_started
items = [
create_item(
"Getting Started",
children=[
getting_started.installati... | 281 | 7,749 |
reflex | docs/app/reflex_docs/templates/docpage/sidebar/sidebar_items/cloud.py | .py | from .item import create_item
def get_sidebar_items_cli_ref():
from reflex_docs.pages.docs.cloud_cliref import pages as cloud_cli_pages
items = [
create_item("CLI Reference", children=cloud_cli_pages),
]
return items
cli_ref = get_sidebar_items_cli_ref()
| 15 | 285 |
reflex | docs/app/reflex_docs/templates/docpage/sidebar/sidebar_items/reference.py | .py | from ..state import SideBarItem
from .item import create_item
def get_sidebar_items_changelog():
from reflex_docs.pages.docs import changelog_packages
return [
SideBarItem(names=package, link=route)
for package, route in changelog_packages.items()
]
def get_sidebar_items_api_reference()... | 38 | 1,015 |
reflex | docs/app/reflex_docs/templates/docpage/sidebar/sidebar_items/enterprise.py | .py | """Enterprise sidebar items."""
from ..state import SideBarItem
def get_sidebar_items_enterprise_usage():
"""Get the enterprise usage sidebar items."""
from reflex_docs.pages.docs import enterprise
return [
SideBarItem(
names="Overview",
children=[
SideBar... | 293 | 9,788 |
reflex | docs/app/reflex_docs/templates/docpage/sidebar/sidebar_items/component_lib.py | .py | import reflex as rx
from reflex.utils.format import to_snake_case, to_title_case
from ..state import SideBarItem
def get_display_name(name: str) -> str:
normalized = to_snake_case(name)
if normalized == "html":
return "HTML"
if normalized == "svg":
return "SVG"
return to_title_case(no... | 125 | 3,718 |
reflex | docs/app/reflex_docs/templates/docpage/sidebar/sidebar_items/ai.py | .py | from ..state import SideBarItem
from .item import create_item
def get_sidebar_items_ai_builder_overview():
from reflex_docs.pages.docs import ai_builder
return [
create_item(
"Overview",
children=[
ai_builder.overview.best_practices,
ai_builder.... | 222 | 7,243 |
reflex | docs/app/reflex_docs/templates/docpage/sidebar/sidebar_items/recipes.py | .py | from .item import create_item
def get_sidebar_items_recipes():
from reflex_docs.pages.docs import recipes
return [
create_item(
"Layout",
children=[
recipes.layout.navbar,
recipes.layout.sidebar,
recipes.layout.footer,
... | 48 | 1,205 |
reflex | docs/app/reflex_docs/views/animated_box.py | .py | import reflex as rx
def typing_text_script():
return """
var txt = 'reflex deploy';
var speed = 50;
var isAnimating = false; // Add flag to track animation state
function typeWriter(element, i) {
if (isAnimating) return; // Don't start if animation is running
... | 303 | 14,908 |
reflex | docs/app/reflex_docs/views/algolia.py | .py | """Compatibility import for the shared Algolia search component."""
from reflex_site_shared.components.algolia import AlgoliaSearch, Search, algolia_search
__all__ = ["AlgoliaSearch", "Search", "algolia_search"]
| 6 | 214 |
reflex | docs/app/reflex_docs/views/search.py | .py | """Search bar component for the navbar."""
import reflex as rx
from .algolia import algolia_search
@rx.memo
def search_bar() -> rx.Component:
return algolia_search()
| 11 | 174 |
reflex | docs/app/reflex_docs/views/docs_navbar.py | .py | import reflex as rx
import reflex_components_internal as ui
from reflex_components_internal.blocks.demo_form import demo_form_dialog
from reflex_site_shared.components.docs_shell import docs_navbar_frame
from reflex_site_shared.components.icons import get_icon
from reflex_site_shared.components.marketing_button import ... | 186 | 7,284 |
reflex | docs/app/reflex_docs/views/bottom_section/newsletter.py | .py | import reflex as rx
from reflex_site_shared.backend.signup import IndexState
from reflex_docs.components.button import button
def newsletter_input() -> rx.Component:
return rx.box(
rx.cond(
IndexState.signed_up,
rx.box(
rx.box(
rx.icon(
... | 104 | 4,389 |
reflex | docs/app/reflex_docs/views/bottom_section/get_started.py | .py | import reflex as rx
import reflex_components_internal as ui
from reflex_site_shared.components.icons import get_icon
from reflex_docs.components.hint import hint
def code_block() -> rx.Component:
return rx.box(
# Glow
rx.html(
"""<svg xmlns="http://www.w3.org/2000/svg" width="598" hei... | 78 | 3,485 |
reflex | tests/__init__.py | .py | """Root directory for tests."""
import os
from reflex_base import constants
| 6 | 78 |
reflex | tests/test_node_version.py | .py | """Test for latest node version being able to run reflex."""
from __future__ import annotations
from collections.abc import Generator
from typing import Any
import httpx
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
def TestNodeVersionApp():
"""A test app for... | 74 | 1,930 |
reflex | tests/integration/test_input.py | .py | """Integration tests for text input and related components."""
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from reflex.testing import AppHarness
def FullyControlledInput():
"""App using a fully controlled input ... | 190 | 6,361 |
reflex | tests/integration/test_deploy_url.py | .py | """Integration tests for deploy_url."""
from __future__ import annotations
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.support.ui import WebDriverWait
from reflex.testing import AppH... | 106 | 3,024 |
reflex | tests/integration/lighthouse_utils.py | .py | """Shared utilities for Lighthouse benchmarking."""
from __future__ import annotations
import json
import operator
import os
import re
import shlex
import shutil
import subprocess
import time
import urllib.request
from dataclasses import dataclass
from functools import cache
from pathlib import Path
from typing impor... | 1,086 | 35,879 |
reflex | tests/integration/test_server_side_event.py | .py | """Integration tests for special server side events."""
import time
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness
def ServerSideEvent():
"""App with inputs set via event handlers and set_value."""
import reflex as rx
... | 213 | 6,057 |
reflex | tests/integration/utils.py | .py | """Helper utilities for integration tests."""
from __future__ import annotations
from collections.abc import Generator, Iterator, Sequence
from contextlib import contextmanager
from http.client import HTTPConnection
from urllib.parse import urlsplit
from selenium.webdriver.common.by import By
from selenium.webdriver... | 377 | 11,840 |
reflex | tests/integration/test_client_storage.py | .py | """Integration tests for client side storage."""
from __future__ import annotations
import asyncio
from collections.abc import Generator
import pytest
from reflex_base.constants.state import FIELD_MARKER
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.webdriver import WebDriver as Firefox... | 807 | 27,392 |
reflex | tests/integration/test_var_operations.py | .py | """Integration tests for var operations."""
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness
def VarOperations():
"""App with var operations."""
from typing import TypedDict
import pydantic
from reflex_base.vars.b... | 1,157 | 42,947 |
reflex | tests/integration/test_background_task.py | .py | """Test @rx.event(background=True) task functionality."""
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import DEFAULT_TIMEOUT, AppHarness, WebDriver
def BackgroundTask():
"""Test that background tasks work as expected."""
import asyncio... | 489 | 15,595 |
reflex | tests/integration/test_dynamic_components.py | .py | """Integration tests for var operations."""
from collections.abc import Generator
from typing import TypeVar
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness
# pyright: reportOptionalMemberAccess=false, reportGeneralTypeIssues=false, reportUnknownMemberType=false
def... | 195 | 5,473 |
reflex | tests/integration/test_prod_build_pipeline.py | .py | """Integration tests for the production build pipeline.
Tests precompressed assets against a real prod build served via AppHarnessProd.
"""
from __future__ import annotations
from collections.abc import Generator
from pathlib import Path
import pytest
import reflex.constants as constants
import reflex.utils.prereq... | 159 | 4,749 |
reflex | tests/integration/test_precompressed_frontend.py | .py | """Integration tests for precompressed production frontend responses."""
from __future__ import annotations
from collections.abc import Generator
import pytest
from reflex.testing import AppHarnessProd
from tests.integration.utils import request_raw
# (config name, Accept-Encoding token, magic-byte prefix or None)... | 117 | 3,301 |
reflex | tests/integration/test_urls.py | .py | """Integration tests for all urls in Reflex."""
import os
import re
from pathlib import Path
import pytest
import requests
def check_urls(repo_dir: Path):
"""Check that all URLs in the repo are valid and secure.
Args:
repo_dir: The directory of the repo.
Returns:
A list of errors.
... | 69 | 2,129 |
reflex | tests/integration/test_memory_state_manager_expiration.py | .py | """Integration tests for in-memory state expiration."""
import time
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver
from reflex.istate.manager.memory import StateManagerMemory
from reflex.testing import AppHarne... | 160 | 5,060 |
reflex | tests/integration/test_auto_memo.py | .py | """Integration tests for compiler-generated experimental memos."""
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness
from .utils import poll_for_navigation
def AutoMemoAcrossPagesApp():
"""Reflex app that shares one stateful s... | 74 | 2,227 |
reflex | tests/integration/test_computed_vars.py | .py | """Test computed vars."""
from __future__ import annotations
import asyncio
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import DEFAULT_TIMEOUT, AppHarness, WebDriver
def ComputedVars():
"""Test app for computed vars."""
import reflex ... | 263 | 7,874 |
reflex | tests/integration/test_hybrid_properties.py | .py | """Test hybrid properties."""
from __future__ import annotations
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from reflex.testing import DEFAULT_TIMEOUT, AppHarness, WebDriver
def HybridProperties():
"""Test app... | 287 | 9,327 |
reflex | tests/integration/test_telemetry_compile.py | .py | """Integration test for the ``compile`` telemetry event.
Drives a real ``AppHarness`` compile against an app that exercises every
field surfaced in ``features_used``, captures ``telemetry.send`` to a JSONL
file inside the test app, then asserts the emitted counts.
The compile pipeline runs end-to-end here, so a regre... | 212 | 7,650 |
reflex | tests/integration/test_typeddict_form_submit.py | .py | """Integration tests for TypedDict-annotated form submissions."""
import asyncio
import functools
import json
from collections.abc import Generator
import pytest
from reflex_base.utils import format
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness
def TypedDictFormSubmit(form_compo... | 237 | 6,771 |
reflex | tests/integration/test_upload.py | .py | """Integration tests for file upload."""
from __future__ import annotations
import asyncio
import json
import shutil
import time
from collections.abc import Callable, Generator
from pathlib import Path
from typing import Any
import pytest
from reflex_base.constants.event import Endpoint
from selenium.common.exceptio... | 1,129 | 38,862 |
reflex | tests/integration/test_form_submit.py | .py | """Integration tests for forms."""
import asyncio
import functools
import json
from collections.abc import Generator
import pytest
from reflex_base.utils import format
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from reflex.testing import AppHarness
def FormSubmit(fo... | 255 | 8,263 |
reflex | tests/integration/test_memo.py | .py | """Integration tests for the ``rx._x.memo`` deprecation shim."""
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness
def MemoApp():
"""Reflex app that exercises memo functions and components via ``rx._x.memo``."""
import refl... | 135 | 4,092 |
reflex | tests/integration/test_tailwind.py | .py | """Test case for disabling tailwind in the config."""
import functools
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness
PARAGRAPH_TEXT = "Tailwind Is Cool"
PARAGRAPH_CLASS_NAME = "text-red-500"
TEXT_RED_500_COLOR_v3 = ["rgba(239, 6... | 150 | 5,123 |
reflex | tests/integration/test_extra_overlay_function.py | .py | """Test case for adding an overlay component defined in the rxconfig."""
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness, WebDriver
def ExtraOverlay():
import reflex as rx
def index():
return rx.vstack(
... | 88 | 2,317 |
reflex | tests/integration/test_dynamic_routes.py | .py | """Integration tests for dynamic route page behavior."""
from __future__ import annotations
import asyncio
import json
from collections.abc import Generator
from urllib.parse import urlsplit
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness, WebDriver
from .utils impor... | 420 | 14,416 |
reflex | tests/integration/test_shared_state.py | .py | """Test shared state."""
from __future__ import annotations
from collections.abc import Generator
import pytest
from reflex.testing import AppHarness, WebDriver
def SharedStateApp():
"""Test that shared state works as expected."""
import reflex as rx
from tests.integration.shared.state import SharedSt... | 78 | 1,671 |
reflex | tests/integration/test_state_inheritance.py | .py | """Test state inheritance."""
from __future__ import annotations
from collections.abc import Generator
from contextlib import suppress
import pytest
from selenium.common.exceptions import NoAlertPresentException
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.common.by import By
from refle... | 454 | 16,295 |
reflex | tests/integration/test_component_state.py | .py | """Test that per-component state scaffold works and operates independently."""
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness
from . import utils
def ComponentStateApp():
"""App using per component state."""
from typing... | 235 | 7,831 |
reflex | tests/integration/test_exception_handlers.py | .py | """Integration tests for event exception handlers."""
from __future__ import annotations
import time
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.support import expected_conditions as ... | 203 | 5,775 |
reflex | tests/integration/test_event_chain.py | .py | """Ensure that Event Chains are properly queued and handled between frontend and backend."""
from __future__ import annotations
import os
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness, WebDriver
from tests.integration.utils impo... | 779 | 25,029 |
reflex | tests/integration/test_navigation.py | .py | """Integration tests for links and related components."""
from collections.abc import Generator
from urllib.parse import urlsplit
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness
from .utils import SessionStorage, poll_for_navigation
def NavigationApp():
"""Refle... | 95 | 2,556 |
reflex | tests/integration/test_media.py | .py | """Integration tests for media components."""
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness
def MediaApp():
"""Reflex app with generated images."""
import io
import httpx
from PIL import Image
import refle... | 203 | 6,682 |
reflex | tests/integration/test_large_state.py | .py | """Test large state."""
import time
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness, WebDriver
def _large_state_app_template(var_count: int) -> str:
var_part = "\n".join(
f' var{i}: str = "{i}" * 10000' for i in range(1, var_count)
)
return f""... | 97 | 2,753 |
reflex | tests/integration/test_linked_state.py | .py | """Test linked state."""
from __future__ import annotations
import uuid
from collections.abc import Callable, Generator
import httpx
import pytest
from reflex_base.config import get_config
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.remote.webel... | 745 | 28,450 |
reflex | tests/integration/test_event_actions.py | .py | """Ensure stopPropagation and preventDefault work as expected."""
from __future__ import annotations
import asyncio
import time
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expect... | 371 | 12,610 |
reflex | tests/integration/test_login_flow.py | .py | """Integration tests for client side storage."""
from __future__ import annotations
from collections.abc import Generator
import pytest
from reflex_base.constants.state import FIELD_MARKER
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from selenium.webdrive... | 155 | 4,316 |
reflex | tests/integration/test_icon.py | .py | """Integration tests for the Icon component."""
from collections.abc import Generator
import pytest
from reflex_components_lucide.icon import LUCIDE_ICON_LIST
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness, WebDriver
def Icons():
from reflex_components_lucide.icon import LUCI... | 106 | 2,762 |
reflex | tests/integration/test_lifespan.py | .py | """Test cases for the Starlette lifespan integration."""
import functools
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from reflex.testing import AppHarness
from .utils import SessionStorage
pytest.importorskip("fastapi")
def LifespanApp(
mount_cached_fastap... | 322 | 11,251 |
reflex | tests/integration/test_call_script.py | .py | """Integration tests for client side storage."""
from __future__ import annotations
from collections.abc import Generator
import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver
from reflex.testing import AppHarness
from .utils import SessionStorage
def... | 557 | 19,562 |
reflex | tests/integration/test_connection_banner.py | .py | """Test case for displaying the connection banner when the websocket drops."""
import asyncio
import contextlib
import pickle
from collections.abc import AsyncGenerator, Generator, Iterator
import pytest
import pytest_asyncio
from redis.asyncio import Redis
from reflex_base import constants
from selenium.common.excep... | 315 | 9,809 |
reflex | tests/integration/test_lighthouse.py | .py | """Lighthouse benchmark tests for production Reflex apps."""
from __future__ import annotations
from pathlib import Path
import pytest
from .lighthouse_utils import (
run_landing_prod_lighthouse_benchmark,
should_run_lighthouse,
)
pytestmark = pytest.mark.skipif(
not should_run_lighthouse(),
reason... | 51 | 1,361 |
reflex | tests/integration/conftest.py | .py | """Shared conftest for all integration tests."""
import pytest
from pytest_mock import MockerFixture
import reflex.app
from reflex.testing import AppHarness, AppHarnessProd
@pytest.fixture(
scope="session", params=[AppHarness, AppHarnessProd], ids=["dev", "prod"]
)
def app_harness_env(request):
"""Parametri... | 45 | 1,174 |
reflex | tests/integration/shared/state.py | .py | """Simple module which contains one reusable reflex state class."""
import reflex as rx
class SharedState(rx.State):
"""Shared state class for reflexers using libraries."""
| 8 | 180 |
reflex | tests/integration/tests_playwright/test_debounce_input.py | .py | """Integration test for ``rx.debounce_input`` wrapping native ``rx.el`` elements.
Regression coverage for the frontend ``ReferenceError: input is not defined``
that fired when DebounceInput passed a native DOM tag (e.g. ``rx.el.input``)
as a bare identifier in the ``element`` prop instead of a string literal.
"""
fro... | 112 | 3,410 |
reflex | tests/integration/tests_playwright/test_appearance.py | .py | from collections.abc import Generator
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
def DefaultLightModeApp():
from reflex_base.style import color_mode
import reflex as rx
app = rx.App(theme=rx.theme(appearance="light"))
@app.add_page
def ind... | 300 | 9,322 |
reflex | tests/integration/tests_playwright/test_textarea_enter_key_submit.py | .py | """Integration test for ``rx.el.textarea(enter_key_submit=True)``.
Regression coverage for the frontend ``ReferenceError: enterKeySubmitOnKeyDown
is not defined`` that fired when the helper JS was dropped during plugin-based
compilation. Pressing Enter inside the textarea must submit the parent form
without raising a ... | 115 | 3,431 |
reflex | tests/integration/tests_playwright/test_stateless_app.py | .py | """Integration tests for a stateless app."""
from collections.abc import Generator
import httpx
import pytest
from playwright.sync_api import Page, expect
from reflex_base.config import get_config
from reflex_base.constants import Endpoint
from reflex.testing import AppHarness
def StatelessApp():
"""A stateles... | 62 | 1,744 |
reflex | tests/integration/tests_playwright/test_client_error.py | .py | """Integration tests for reporting state deltas the frontend cannot process.
A delta whose substate has no dispatch function in the compiled frontend means
the frontend and backend disagree about the state tree. The frontend reports it
back over the ``client_error`` socket event so the failure is visible in the
backen... | 165 | 5,293 |
reflex | tests/integration/tests_playwright/test_plotly.py | .py | """Integration tests for the plotly graphing component's locale support."""
from collections.abc import Generator
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
def PlotlyLocaleApp():
"""App rendering a plotly figure with no locale, two locales, and a state con... | 176 | 6,620 |
reflex | tests/integration/tests_playwright/test_mount_target.py | .py | """Integration tests for the ``mount_target`` config option.
Builds the app in prod mode with ``mount_target`` set, then serves a
hand-written host HTML page that loads the bundle's entry script and contains
``<div id="reflex-root">`` so we can verify the app mounts inside it instead of
taking over ``<html>``/``<body>... | 170 | 5,622 |
reflex | tests/integration/tests_playwright/test_hmr.py | .py | """Integration tests for browser hot module replacement."""
import json
import time
from collections.abc import Generator
from pathlib import Path
import pytest
from playwright.sync_api import Page, WebSocket, expect
from reflex.testing import AppHarness
def HmrApp():
"""Create an app with a route that remains... | 140 | 4,479 |
reflex | tests/integration/tests_playwright/test_table.py | .py | """Integration tests for table and related components."""
from collections.abc import Generator
import pytest
from playwright.sync_api import Page, expect
from reflex.testing import AppHarness
expected_col_headers = ["Name", "Age", "Location"]
expected_row_headers = ["John", "Jane", "Joe"]
expected_cells_data = [
... | 105 | 3,139 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.