Skip to content
New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix group filtering #33

Merged
merged 1 commit into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run E2E tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm install pnpm -g
- run: pnpm install
- run: pnpm playwright install --with-deps
- run: pnpm build
- run: pnpm test
- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
with:
name: playwright-report
path: playwright-report
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.idea
.env
.env.local
.env.development
Expand Down
2 changes: 1 addition & 1 deletion cmdk/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ const Group = React.forwardRef<HTMLDivElement, GroupProps>((props, forwardedRef)
const headingRef = React.useRef<HTMLDivElement>(null)
const headingId = React.useId()
const context = useCommand()
const render = useCmdk((state) => (!state.search ? true : state.filtered.groups.has(id)))
const render = useCmdk((state) => context.filter() === false ? true : (!state.search ? true : state.filtered.groups.has(id)))

useLayoutEffect(() => {
return context.group(id)
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const config: PlaywrightTestConfig = {
testDir: './test',
use: {
trace: 'on-first-retry',
baseURL: process.env.CI ? process.env.BASE_URL : 'http://localhost:3000',
baseURL: 'http://localhost:3000',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we'd test against the vercel deployment, but I think for now this is better than nothing?

},
timeout: 5000,
webServer: {
Expand Down