Skip to content

Commit

Permalink
Fix group filtering (pacocoursey#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviouk authored Aug 17, 2022
1 parent 9db9a27 commit cb87e6b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
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',
},
timeout: 5000,
webServer: {
Expand Down

0 comments on commit cb87e6b

Please sign in to comment.