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

fix: display app templates correctly in build preview#10994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Kira-Pilot merged 5 commits intomainfrompreview-display-apps/kira-pilot
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
handling empty state
  • Loading branch information
@Kira-Pilot
Kira-Pilot committedDec 5, 2023
commit8b65aa8d85f53752ea974adf2cfc5fe7112abb0c
36 changes: 36 additions & 0 deletionssite/src/components/Resources/AgentRowPreview.test.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,22 @@ const NoVSCode = {
] as DisplayApp[],
};

const NoModulesJustApps = {
...MockWorkspaceAgent,
apps: [],
};

const NoAppsJustModules = {
...MockWorkspaceAgent,
display_apps: [] as DisplayApp[],
};

const EmptyAppPreview = {
...MockWorkspaceAgent,
apps: [],
display_apps: [] as DisplayApp[],
};

describe("AgentRowPreviewApps", () => {
it.each<{
workspaceAgent: WorkspaceAgent;
Expand All@@ -55,6 +71,18 @@ describe("AgentRowPreviewApps", () => {
workspaceAgent: NoVSCode,
testName: "NoVSCode",
},
{
workspaceAgent: NoModulesJustApps,
testName: "NoModulesJustApps",
},
{
workspaceAgent: NoAppsJustModules,
testName: "NoAppsJustModules",
},
{
workspaceAgent: EmptyAppPreview,
testName: "EmptyAppPreview",
},
])(
`<AgentRowPreview agent={$testName} /> displays appropriately`,
({ workspaceAgent }) => {
Expand DownExpand Up@@ -92,6 +120,14 @@ describe("AgentRowPreviewApps", () => {
screen.queryByText(DisplayAppNameMap[app]),
).not.toBeInTheDocument();
});

// test empty state
if (
workspaceAgent.display_apps.length === 0 &&
workspaceAgent.apps.length === 0
) {
expect(screen.getByText("None")).toBeInTheDocument();
}
},
);
});
2 changes: 1 addition & 1 deletionsite/src/components/Resources/AgentRowPreview.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -125,7 +125,7 @@ export const AgentRowPreview: FC<AgentRowPreviewProps> = ({
</AppPreview>
)
)}
{agent.apps.length === 0 && (
{agent.apps.length === 0 &&agent.display_apps.length === 0 &&(
<span css={styles.agentDataValue}>None</span>
)}
</Stack>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp