MCPcopy Index your code
hub / github.com/coder/coder / TestingScreen

Function TestingScreen

site/src/contexts/ProxyContext.test.tsx:131–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129
130// TestingScreen just mounts some components that we can check in the unit test.
131const TestingScreen = () => {
132 const {
133 proxy,
134 userProxy,
135 isFetched,
136 isLoading,
137 latenciesLoaded,
138 clearProxy,
139 setProxy,
140 } = useProxy();
141
142 return (
143 <>
144 <div
145 data-testid="latenciesLoaded"
146 title={latenciesLoaded.toString()}
147 ></div>
148 <div data-testid="isFetched" title={isFetched.toString()}></div>
149 <div data-testid="isLoading" title={isLoading.toString()}></div>
150 <div data-testid="preferredProxy" title={proxy.proxy?.id}></div>
151 <div data-testid="userProxy" title={userProxy?.id}></div>
152 <button data-testid="clearProxy" onClick={clearProxy}></button>
153 <div data-testid="userSelectProxyData"></div>
154 <button
155 data-testid="userSelectProxy"
156 onClick={() => {
157 const data = screen.getByTestId("userSelectProxyData");
158 if (data.innerText) {
159 setProxy(JSON.parse(data.innerText));
160 }
161 }}
162 ></button>
163 </>
164 );
165};
166
167interface ProxyContextSelectionTest {
168 // Regions is the list of regions to return via the "api" response.

Callers

nothing calls this directly

Calls 2

useProxyFunction · 0.90
parseMethod · 0.80

Tested by

no test coverage detected