Skip to content

Commit 7d30cc4

Browse files
committed
refactor(global-search): update App component to include SearchScene
Modified the App component to render SearchScene based on activeScene and adjusted the test to verify the presence of search interface elements.
1 parent 77edafb commit 7d30cc4

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

plugins/global-search/src/App.test.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { describe, expect, it } from "vitest"
44
import { App } from "./App"
55

66
describe("App", () => {
7-
it("should render", () => {
7+
it("should render search interface", () => {
88
render(<App />)
9-
expect(screen.getByText(/Welcome!/gi)).toBeInTheDocument()
9+
expect(screen.getByPlaceholderText(/Search/i)).toBeInTheDocument()
10+
expect(screen.getByLabelText(/Search for anything in your Framer project/i)).toBeInTheDocument()
1011
})
1112
})

plugins/global-search/src/App.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { framer } from "framer-plugin"
22
import { useEffect, useState } from "react"
33
import { ErrorBoundary } from "react-error-boundary"
44
import { DevToolsScene } from "./components/DevToolsScene"
5+
import { SearchScene } from "./components/SearchScene"
56
import { IndexerProvider } from "./utils/indexer/IndexerProvider"
67

78
framer.showUI({
89
position: "top right",
9-
width: 400,
10-
height: 600,
11-
resizable: true,
10+
width: 280,
11+
height: 64,
1212
})
1313

1414
export function App() {
@@ -34,11 +34,8 @@ export function App() {
3434
)}
3535
>
3636
<IndexerProvider>
37-
{activeScene === "dev-tools" ? (
38-
<DevToolsScene />
39-
) : (
40-
<div>Welcome! This is under development. Select "Open Dev Tools" to get started.</div>
41-
)}
37+
{activeScene === "dev-tools" && <DevToolsScene />}
38+
{activeScene === "search" && <SearchScene />}
4239
</IndexerProvider>
4340
</ErrorBoundary>
4441
)

0 commit comments

Comments
 (0)