# Code maintenance OP-20827 - Share a plugin context stub across Stimulus controller specs

Project: OpenProject
Status: in development
URL: https://community.openproject.org/work_packages/OP-20827

## OPEN POINTS

_No work packages_

## Subtasks

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Assignee | Kabiru Mwenja |
| Accountable |  |
| Designer |  |
| Developers | Kabiru Mwenja |
| Requires doc change | No |
| Date |  |
| Priority | Medium |
| Target versions | 18.1.0 |
| Sprint |  |
| Backlog bucket |  |
| Module |  |
| Accessibility | No |
| List |  |
| Labels |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| Work |  |
| Remaining work |  |

## Description

About 30 Stimulus controller specs stub `window.OpenProject.getPluginContext` inline to provide Angular services to controllers using `useAngularServices`, in a resolved and a pending variant, each saving and restoring the global by hand.

Extract one shared test helper for both variants and use it in those specs. Test-only change, no production code.

Noticed in https://github.com/opf/openproject/pull/26970 (COMMS-649).
