Skip to content

client: VR test helper's cleanUp() indiscriminately wipes document.body/head #871

Description

@YusukeHirao

発見の経緯

ERM (Explicit Resource Management) 導入作業の事前調査で見つかったスコープ外項目。

内容

packages/@burger-editor/client/src/__tests__/vr/vr-helper.ts:66-77cleanUp() は dialog close + remove + document.body.innerHTML = '' + head 内 style 全削除を一括で行う。各 VR spec が beforeEach(injectCSS) / afterEach(cleanUp) で使っているが、「DOM 全部なぎ倒す」実装は他テストの副作用も消してしまう乱暴な後始末になっている。

対応方針(要検討)

  • injectCSS() / renderDialog() / renderElement()Disposable を返す形にし、「作った本人が消す」設計に変更する
  • 効果対リスク(VR スクリーンショットに影響するリファクタ)を踏まえ、着手前に影響範囲を精査すること

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions