Skip to content

Commit 2b18166

Browse files
committed
Add FilledTonalButton macOS golden test & docs
Add a basic golden image and visual test for FilledTonalButton on macOS: new basic.png, updated image_for_docs.png, and a new test_basic that loads examples.controls.material.filled_tonal_button.basic.main and asserts a page screenshot. Update the macOS workflow to include examples/controls/material and adjust examples paths. Fix docs to reference example_images (basic.png) so the example image is displayed correctly.
1 parent 5fcbeef commit 2b18166

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

.github/workflows/macos-integration-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ jobs:
4141
suite:
4242
- apps
4343
- examples/apps
44-
- examples/core
45-
- examples/cupertino
44+
- examples/controls/core
45+
- examples/controls/cupertino
46+
- examples/controls/material
4647
- examples/extensions
47-
- examples/material
4848
- controls/core
4949
- controls/cupertino
5050
- controls/material
17.2 KB
Loading
27 Bytes
Loading

sdk/python/packages/flet/integration_tests/examples/controls/material/test_filled_tonal_button.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import flet as ft
44
import flet.testing as ftt
5+
from examples.controls.material.filled_tonal_button.basic import main as basic
56

67

78
@pytest.mark.asyncio(loop_scope="function")
@@ -11,3 +12,17 @@ async def test_image_for_docs(flet_app_function: ftt.FletTestApp, request):
1112
request.node.name,
1213
ft.FilledTonalButton(content="Tap me"),
1314
)
15+
16+
17+
@pytest.mark.parametrize(
18+
"flet_app_function",
19+
[{"flet_app_main": basic.main}],
20+
indirect=True,
21+
)
22+
@pytest.mark.asyncio(loop_scope="function")
23+
async def test_basic(flet_app_function: ftt.FletTestApp):
24+
flet_app_function.page.theme_mode = ft.ThemeMode.LIGHT
25+
flet_app_function.assert_screenshot(
26+
"basic",
27+
await flet_app_function.take_page_controls_screenshot(),
28+
)

website/docs/controls/filledtonalbutton.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ import {ClassMembers, ClassSummary, CodeExample, Image} from '@site/src/componen
1818

1919
<CodeExample path={frontMatter.examples + '/basic/main.py'} language="python" />
2020

21-
<Image src={frontMatter.example_media + '/basic.png'} alt="basic" width="25%" />
21+
<Image src={frontMatter.example_images + '/basic.png'} alt="basic" width="25%" />
2222

2323
<ClassMembers name={frontMatter.class_name} />

0 commit comments

Comments
 (0)