Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdd0c6ac

Browse files
test: ensure 'hidden' property hides app from UI
1 parent2ec4646 commitdd0c6ac

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

‎site/src/modules/resources/AgentRow.test.tsx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
MockTemplate,
44
MockWorkspace,
55
MockWorkspaceAgent,
6+
MockWorkspaceApp,
67
}from"testHelpers/entities";
78
import{
89
renderWithAuth,
@@ -106,3 +107,60 @@ describe.each<{
106107
}
107108
});
108109
});
110+
111+
describe.each<{
112+
props:Partial<AgentRowProps>;
113+
}>([
114+
{
115+
props:{
116+
agent:{
117+
...MockWorkspaceAgent,
118+
apps:[
119+
{
120+
...MockWorkspaceApp,
121+
hidden:false,
122+
},
123+
],
124+
},
125+
},
126+
},
127+
{
128+
props:{
129+
agent:{
130+
...MockWorkspaceAgent,
131+
apps:[
132+
{
133+
...MockWorkspaceApp,
134+
hidden:true,
135+
},
136+
],
137+
},
138+
},
139+
},
140+
])("hidden hides App button",({props:testProps})=>{
141+
constprops:AgentRowProps={
142+
agent:MockWorkspaceAgent,
143+
workspace:MockWorkspace,
144+
template:MockTemplate,
145+
showApps:true,
146+
serverVersion:"",
147+
serverAPIVersion:"",
148+
onUpdateAgent:()=>{
149+
thrownewError("Function not implemented.");
150+
},
151+
...testProps,
152+
};
153+
154+
test(`apps:${props.agent.apps}`,async()=>{
155+
renderWithAuth(<AgentRow{...props}/>);
156+
awaitwaitForLoaderToBeRemoved();
157+
158+
for(constappofprops.agent.apps){
159+
if(app.hidden){
160+
expect(screen.queryByText(app.display_name)).toBeNull();
161+
}else{
162+
expect(screen.getByText(app.display_name)).toBeVisible();
163+
}
164+
}
165+
});
166+
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp