Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CalloutLayoutConstraintsCalculatorのUnitテスト #2

Open
shunm-999 opened this issue Feb 4, 2025 · 0 comments
Open

CalloutLayoutConstraintsCalculatorのUnitテスト #2

shunm-999 opened this issue Feb 4, 2025 · 0 comments
Labels
type:test Implementation of test

Comments

@shunm-999
Copy link
Contributor

shunm-999 commented Feb 4, 2025

Feature/Module to be Tested
CalloutLayoutConstraintsCalculator[core]

前提:
Popup内の、子のComposableのサイズがスクリーンを超える場合は、
子のComposableは見切れずに、Popupがずれることで対応される。

そのため、Popupの位置を指定しても、
場合によっては、指定した位置からずれた位置にPopupが描画される可能性がある。

callout-composeでは、子のComposableのサイズを制限することで、
上記の事象が発生しないようにしている。

CalloutLayoutConstraintsCalculatorは、
子のComposableのサイズ制限を計算するクラスである。

仕様:
[Input]

  • density
  • 吹き出し表示位置
  • 親のComposableのサイズ
  • Anchor対象のComposableのサイズ

[Output]
吹き出しのComposableが取りうるサイズの制約

  • minWidth
  • minHeight
  • maxWidth
  • maxHeight

Purpose of the Test
CalloutLayoutConstraintsCalculatorが出力する、サイズ制限が正しいことを検証する。

Test Scenarios

以下の2つの条件の組み合わせをすべて検証する。

  • 吹き出しの表示位置(12種類)
  • 子のComposableがサイズが、スクリーンの描画領域を超える or 超えない

12 * 2 = 24パターンのテストが必要。

Expected Outcomes
指定したCalloutの表示位置と、子のComposableのサイズに適した制限を出力される。

@shunm-999 shunm-999 added the type:test Implementation of test label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:test Implementation of test
Projects
None yet
Development

No branches or pull requests

1 participant