test: スクリプトスコープ伝播・分離とlayoutBeforeRenderのインテグレーションテスト追加#126
Merged
Conversation
確認済み観点: - m:insert/m:extendsでのスコープ伝播・分離 - 同名変数のシャドウイング優先順位 - var有無による祖先スコープへの影響 - bindingインフォーマルプロパティ(正常/未定義フォールバック) - 3段m:extendsの成功系と欠損系(layout1/layout2未定義)
確認したテスト観点: - layout beforeRender単体実行での値反映 - target/layout両beforeRender実行時の値可視性 - beforeRender実行順序(target→layout)の固定化 - 同名requestキー競合時の優先順位(layout上書き) - request以外(varスコープ)のlayout側参照可否
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
m:insert/m:extendsによるページ間スコープ伝播・分離の動作を体系的に検証するインテグレーションテストを追加する。テストは旧パーサー・新パーサーの両方 (
@ValueSource(booleans = { false, true })) で実行し、パーサー実装差異による退行が起きないことも同時に確認する。追加テストクラス
ScriptScopeIntegrationTest(+1324行)m:insert/m:extendsを組み合わせたページ間スコープ動作を網羅的に検証する。beforeRender変数がm:insertコンポーネント内で参照できるscope-propagate-to-insertm:insertコンポーネントから共通祖先スコープの変数を参照できるscope-propagate-to-sibling-insertsbeforeRender変数はコンポーネント B から参照できない(スコープ分離)scope-isolation-between-sibling-insertsm:extendsレイアウトのbeforeRender変数をコンテンツテンプレートから参照できるlayout-extends-layout-var-to-contentm:extendsターゲットのbeforeRender変数をレイアウトテンプレートから参照できるlayout-extends-target-var-to-layoutm:extendsのbeforeRender内でload()した JS が同スコープに展開され、layout / content 双方から参照できるlayout-extends-with-loadscope-shadow-target-vs-layoutbeforeRender変数が 3 段ネストm:insertコンポーネントから参照できるscope-propagate-3-level-nestvarなしで祖先変数を書き換えると兄弟 B にも変更が見える(スコープ Mutation)scope-mutation-by-componentm:insertのインフォーマルプロパティがbindingスコープ経由で参照できるscope-insert-informal-propertyscope-insert-informal-property-missingm:extendsチェーンで全階層のbeforeRender変数が参照できるlayout-extends-3level-chainlayout-extends-3level-chain-missing-l1layout-extends-3level-chain-missing-l2var宣言で同名変数をシャドウしても親スコープは不変scope-component-local-shadowLayoutBeforeRenderIntegrationTest(+380行)m:extendsレイアウト共有時のbeforeRenderスクリプト実行動作を検証する。beforeRenderスクリプトが実行され、値がテンプレートに反映されるlayout-before-render-basicbeforeRenderが実行されるlayout-and-target-before-renderbeforeRenderの実行順序が target → layout の順に固定されているlayout-before-render-orderrequestキーに代入した場合、後から実行される layout 側で上書きされるlayout-before-render-request-shadowrequest以外(target のvar変数)もレイアウトテンプレートから参照できるlayout-before-render-non-request-scope備考
DynamicRegisteredSourceHolder) を使用しているため、テスト用 HTML / mayaa ファイルの追加は不要。@ParameterizedTestで旧・新パーサー両方を実行する。