+
-
- {search.length > 1 &&
- filteredCommands.map((cmdMeta) => (
-
- ))}
+
+ {filteredCommands.map((cmdMeta) => (
+
+ ))}
+ {filteredCommands.length === 0 && }
);
}
+
+const NotFoundPage = () => {
+ return (
+
+
+ No matching data was found🥺
+
+
+
+
+ Try refining your search or browse the documentation for common
+ commands.
+
+
+
+ View Documentation
+
+
+ );
+};
diff --git a/apps/playground-web/components/Search/__tests__/SearchBox.test.tsx b/apps/playground-web/components/Search/__tests__/SearchBox.test.tsx
index aebdfec..d6bd507 100644
--- a/apps/playground-web/components/Search/__tests__/SearchBox.test.tsx
+++ b/apps/playground-web/components/Search/__tests__/SearchBox.test.tsx
@@ -82,14 +82,15 @@ describe('SearchBox Component', () => {
}
});
- it('should not show results when search length is less than 2', async () => {
+ it('should show all commands when search length is 0', async () => {
const { searchInputElement } = setupTest();
- await userEvent.type(searchInputElement, 'A');
-
- Object.values(DiceCmds).forEach((cmd) => {
- expect(
- screen.queryByText(new RegExp(cmd.title, 'i')),
- ).not.toBeInTheDocument();
- });
+ expect(searchInputElement).toBeInTheDocument();
+ const totalCommands = Object.values(DiceCmds).length;
+ const displayedCommands = Array.from(
+ screen
+ .getByTestId('search-container')
+ .querySelectorAll('[data-testid^="command-page"]'),
+ );
+ expect(displayedCommands).toHaveLength(totalCommands);
});
});
diff --git a/tooling/eslint-config/package.json b/tooling/eslint-config/package.json
index c53bbfb..39e8164 100644
--- a/tooling/eslint-config/package.json
+++ b/tooling/eslint-config/package.json
@@ -8,12 +8,12 @@
"react-internal.js"
],
"devDependencies": {
+ "@typescript-eslint/eslint-plugin": "^7.1.0",
+ "@typescript-eslint/parser": "^7.1.0",
"@vercel/style-guide": "^5.2.0",
- "eslint-config-turbo": "^2.0.0",
"eslint-config-prettier": "^9.1.0",
+ "eslint-config-turbo": "^2.0.0",
"eslint-plugin-only-warn": "^1.1.0",
- "@typescript-eslint/parser": "^7.1.0",
- "@typescript-eslint/eslint-plugin": "^7.1.0",
"typescript": "^5.3.3"
}
}