Skip to content

fixed provider filter in resources #4443

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rsun19
Copy link
Contributor

@rsun19 rsun19 commented Jul 1, 2025

https://issues.redhat.com/browse/RHOAIENG-28106

Description

Screenshot 2025-07-01 at 3 15 37 PM

How Has This Been Tested?

Go to the providers checkbox in resources, and click on a provider. It should correctly filter now.

Actually, since I refactored a lot of the deprecated useQueryParams() method, you should also test by clicking on all of the possible filters in the resources page. And ensure the enabled and explore pages work properly.

Test Impact

Updated Cypress tests

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

Summary by CodeRabbit

  • New Features

    • Added a new test provider component and associated documentation to the available resources.
    • Introduced a renamed "Start basic workbench" entry replacing the previous Jupyter label.
  • Bug Fixes

    • Improved filtering logic for documents to ensure more accurate results based on application and provider criteria.
  • Tests

    • Updated test cases to reflect the increased number of resources and new provider, including adjustments to expected counts and filter options.
    • Modified test assertions to accommodate the renamed "Start basic workbench" component.
  • Chores

    • Replaced custom query parameter hooks with the standard useSearchParams from react-router-dom across multiple components and hooks.
    • Removed deprecated custom query parameter hook to streamline URL parameter handling.

Copy link
Contributor

coderabbitai bot commented Jul 1, 2025

## Walkthrough

The changes update mock data for components and documents by splitting a "jupyter" entry into two with distinct metadata, adding a new mock document for "test-provider," and modifying test assertions to reflect increased resource counts and the new provider. The document filter logic is refined for more precise property checks. Additionally, multiple components and hooks replace the custom `useQueryParams` hook with the standard `useSearchParams` from `react-router-dom` for URL query parameter handling, and the deprecated `useQueryParams` hook is removed.

## Changes

| File(s)                                                                                   | Change Summary                                                                                                      |
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
| frontend/src/__mocks__/mockComponents.ts                                                 | Split "jupyter" mock entry into two: one renamed "Start basic workbench" with empty provider, one as "test-provider" with updated fields and icons.          |
| frontend/src/__mocks__/mockDocs.ts                                                       | Added a new mock document for "test-provider" with unique metadata and spec.                                       |
| frontend/src/__tests__/cypress/cypress/tests/mocked/resources/resources.cy.ts            | Updated test assertions: increased expected counts, replaced "Jupyter" provider filter with "test-provider".        |
| frontend/src/pages/learningCenter/useDocFilterer.ts                                      | Refined filtering logic: replaced custom hook with `useSearchParams`, simplified property checks, improved null/undefined handling.           |
| frontend/src/__tests__/cypress/cypress/pages/components/JupyterCard.ts                   | Updated drawer panel heading text from "Jupyter" to "Start basic workbench" in test.                               |
| frontend/src/__tests__/cypress/cypress/tests/mocked/applications/enabled.cy.ts           | Changed expected Jupyter card title text to "Start basic workbench" in test.                                       |
| frontend/src/__tests__/cypress/cypress/tests/mocked/applications/explore.cy.ts           | Renamed test case and updated assertions from "Jupyter" to "Start basic workbench"; removed provider text check.   |
| frontend/src/pages/exploreApplication/ExploreApplications.tsx                            | Replaced custom `useQueryParams` hook with `useSearchParams` for reading `selectId` query parameter.               |
| frontend/src/pages/learningCenter/CategoryFilters.tsx                                   | Replaced `useQueryParams` with `useSearchParams` for reading category query parameter.                             |
| frontend/src/pages/learningCenter/LearningCenter.tsx                                    | Replaced `useQueryParams` with `useSearchParams` for reading sorting parameters.                                  |
| frontend/src/pages/learningCenter/LearningCenterFilters.tsx                             | Replaced `useQueryParams` with `useSearchParams` for reading category filter parameter.                            |
| frontend/src/pages/learningCenter/LearningCenterListHeader.tsx                          | Replaced `useQueryParams` with `useSearchParams` for reading sorting parameters.                                  |
| frontend/src/pages/learningCenter/LearningCenterToolbar.tsx                            | Replaced `useQueryParams` with `useSearchParams` for reading URL query parameters.                                |
| frontend/src/pages/learningCenter/useQueryFilters.ts                                   | Replaced `useQueryParams` with `useSearchParams` for reading filter query parameters.                             |
| frontend/src/utilities/useQueryParams.tsx                                              | Deleted deprecated custom `useQueryParams` hook.                                                                   |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant UI
    participant useDocFilterer
    participant mockDocs

    User->>UI: Applies filters (type, application, provider)
    UI->>useDocFilterer: Calls filter function with query params
    useDocFilterer->>mockDocs: Retrieves documents
    useDocFilterer->>useDocFilterer: Applies type, application, provider filters
    useDocFilterer-->>UI: Returns filtered docs
    UI-->>User: Displays filtered results

Suggested labels

lgtm, approved

Suggested reviewers

  • DaoDaoNoCode
  • manosnoam

Poem

A rabbit hops through fields of code,
New docs and mocks along the road.
Providers split and filters neat,
Test counts rise—no small feat!
With every tweak, the garden grows,
Where learning center magic flows.
🐇✨


<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between d060a9161d0ceabfd540771973b1bf9bf141ef1d and ef43e60c0ba30904599226aa1086a582926de4fb.

</details>

<details>
<summary>📒 Files selected for processing (9)</summary>

* `frontend/src/pages/exploreApplication/ExploreApplications.tsx` (2 hunks)
* `frontend/src/pages/learningCenter/CategoryFilters.tsx` (2 hunks)
* `frontend/src/pages/learningCenter/LearningCenter.tsx` (2 hunks)
* `frontend/src/pages/learningCenter/LearningCenterFilters.tsx` (2 hunks)
* `frontend/src/pages/learningCenter/LearningCenterListHeader.tsx` (2 hunks)
* `frontend/src/pages/learningCenter/LearningCenterToolbar.tsx` (2 hunks)
* `frontend/src/pages/learningCenter/useDocFilterer.ts` (2 hunks)
* `frontend/src/pages/learningCenter/useQueryFilters.ts` (1 hunks)
* `frontend/src/utilities/useQueryParams.tsx` (0 hunks)

</details>

<details>
<summary>💤 Files with no reviewable changes (1)</summary>

* frontend/src/utilities/useQueryParams.tsx

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* frontend/src/pages/learningCenter/useDocFilterer.ts

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧠 Learnings (1)</summary>

<details>
<summary>📓 Common learnings</summary>

Learnt from: Gkrumbach07
PR: #4336
File: frontend/src/pages/notebookController/NotebookLogoutRedirect.tsx:19-19
Timestamp: 2025-06-24T14:18:19.228Z
Learning: Logout functionality in components like NotebookLogoutRedirect that involve browser redirects, OAuth sign out flows, and window.location.href manipulation cannot be effectively tested in mocked unit tests due to their integration nature with external services and browser navigation behavior.


</details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)</summary>

* GitHub Check: Lint
* GitHub Check: Cypress-Setup

</details>

<details>
<summary>🔇 Additional comments (8)</summary><blockquote>

<details>
<summary>frontend/src/pages/exploreApplication/ExploreApplications.tsx (1)</summary>

`2-2`: **LGTM: Clean migration to standard React Router hook**

The replacement of the custom `useQueryParams` hook with the standard `useSearchParams` from `react-router-dom` is implemented correctly. The destructuring pattern and parameter retrieval logic maintain the same functionality while using the standardized approach.




Also applies to: 105-106

</details>
<details>
<summary>frontend/src/pages/learningCenter/LearningCenterListHeader.tsx (1)</summary>

`2-2`: **LGTM: Consistent migration pattern applied**

The migration from `useQueryParams` to `useSearchParams` is implemented correctly and consistently. The sort parameter retrieval logic maintains the same functionality with proper default values.




Also applies to: 18-20

</details>
<details>
<summary>frontend/src/pages/learningCenter/LearningCenterToolbar.tsx (1)</summary>

`3-3`: **LGTM: Comprehensive and consistent migration**

All query parameter retrievals have been properly updated to use `useSearchParams`. The implementation is thorough and maintains all existing functionality while using the standardized React Router hook.




Also applies to: 96-106

</details>
<details>
<summary>frontend/src/pages/learningCenter/CategoryFilters.tsx (1)</summary>

`2-2`: **LGTM: Standard migration pattern correctly applied**

The replacement of `useQueryParams` with `useSearchParams` follows the established pattern and is implemented correctly. The category filter functionality remains unchanged.




Also applies to: 19-20

</details>
<details>
<summary>frontend/src/pages/learningCenter/LearningCenter.tsx (1)</summary>

`4-4`: **LGTM: Migration completed correctly**

The migration from `useQueryParams` to `useSearchParams` is implemented correctly with proper default value handling. The sorting functionality remains unchanged and the code follows the established pattern used across other files.




Also applies to: 38-40

</details>
<details>
<summary>frontend/src/pages/learningCenter/useQueryFilters.ts (1)</summary>

`2-6`: **LGTM: Clean migration to React Router's useSearchParams**

The migration from the custom `useQueryParams` hook to React Router's `useSearchParams` is correct and maintains API compatibility. The `URLSearchParams.get()` method has the same signature and behavior as the custom implementation.

</details>
<details>
<summary>frontend/src/pages/learningCenter/LearningCenterFilters.tsx (2)</summary>

`6-6`: **LGTM: Consistent migration to React Router hook**

The import change aligns with the broader refactor to standardize query parameter handling across the codebase.

---

`31-32`: **LGTM: Proper hook usage with fallback handling**

The migration to `useSearchParams` is correct, and the fallback to empty string (`|| ''`) properly handles the null case that `URLSearchParams.get()` can return.

</details>

</blockquote></details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAM3gADyjefAl4JT54rxo+eCx/RHxsCgZpABpo+2wBZnUaejlIbERKPwcMAEYATnRkW0gMRwFWgBYxgGYy9FpaApbkTBREBw9cKgYAayjsDAzIWFxcbkQOAHpTpBXEDX9aWGoNJmZTgQp8AHcW05sACQB5ACCAEkAKIAOQA4mAAEwADg6AAYAGwaGCwDwMe4YUiQeJJZC4dG4nZieD4DBoLzqeT4WJhIkpNJ7LI5RjozYCfAJFBYQkeApFErSeyicTk/h0vnobjcKkMahkjCoqz+NJFRBeWRTFqRUnY9A8N5M1q0dIDfChJgUfxiTW4+DZVpSgXFUqIADc9NQ2G4tGoHjIDgK9Ooj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YTDftq0sHb99WP5ITvYLnpid8eEnBzla057eC/K1mJJkmlvJG8XAzPfhIMK4BaNZEOInDNiHhZIt2spyQXjUyv7Gd9OwbKIhXxRLRDn0qnM/hp18LFD8eNIkQd53q7v9Yhw6eId/zV5JDhmmvcNJEETR8pw08QFRrGCt5rpMSwyMYrSM5FiDpITLd5JDk/SvC3hwOYYqWXGb7Enecwm7oTgjhbVGAZsA5PsX2GaMCRRAGZBRXNwcJQYJmLtDUjC6cklBXfVAdFybaQZPaV4DNgzjQ4ujXI+wobjcP1B/k+oxQKURqPwDvCogv8fUcF0rYrpRQjAAnImn5gqiRQOzcMbaMBRQDDozgLbOZiUCXh0M2UZDN7AJb+wokuwbxnCWEEGiEBtHPPnlHAIsdgItwLlluiTFZ8xBxA3URTB3qPQCIrCZ8MzlNFhjU+QuKYCJHEC1APh47SgIhBUhf5GgiOOMbYx2DkAaBE1G0JSFNgWlKeFg3jtE2sFgj4mR5a8i6zx46F1yujApgih1GhB0Rf3JvvwmlFd8q2hzf8tGLYx9juBvRKEl1Fr5HMyR48VkToXZGTM723TUbIyMMAGBi42SLSpXC/70A64nAPwGgCbg/9NSCgbOJ3Dzg9xC4yE0OMjHUATx0gc8VUHDjoATxhit1XuChJIBdARgAgaEAiFiDu5xgSIAQB0FoAIg4QXQJELEFhDu4SAIwBgAIFiDc40AcId3AwCRDIhkQsk3nMHBQkIgEQIwWIEiBGBoBucAgWECZNhACB5JsQcYMpNiAySUc3OBEPEmElIheJXQcyXJPdwFwi4FEoSSpLQBdAOgSIQSQiFKAqBYgtAd3CMARDc5uc3QbnOMAEmyTXJsQDoCMA6BVFBJnk8iRAFRixARg4wEgCpIYAIgqE4wBEF0B0nu4ugXQaENCCRBoA0AiIWEHVPdywhoQ1UpEEoF0kCBMpWUqAGtCok0SJ4dEr8AxPDieSgAA -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=opendatahub-io/odh-dashboard&utm_content=4443):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@openshift-ci openshift-ci bot requested review from mturley and pnaik1 July 1, 2025 19:18
@rsun19
Copy link
Contributor Author

rsun19 commented Jul 1, 2025

@DaoDaoNoCode this was caused by us removing the "Jupyter" name from the provider during the manifest changes.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
frontend/src/__mocks__/mockComponents.ts (1)

33-61: Consider extracting the duplicated getStartedMarkDown content.

The new "test-provider" entry is well-structured for testing provider filtering. However, the extensive getStartedMarkDown content is duplicated between both entries.

Consider extracting the common markdown content to reduce duplication:

+const JUPYTER_GETTING_STARTED_MARKDOWN = '# Jupyter\nLaunch Jupyter and start a notebook server...';

export const mockComponents = (): OdhApplication[] => [
  {
    // ... first entry
    spec: {
      // ... other fields
-      getStartedMarkDown: '# Jupyter\nLaunch Jupyter and start a notebook server...',
+      getStartedMarkDown: JUPYTER_GETTING_STARTED_MARKDOWN,
    },
  },
  {
    // ... second entry  
    spec: {
      // ... other fields
-      getStartedMarkDown: '# Jupyter\nLaunch Jupyter and start a notebook server...',
+      getStartedMarkDown: JUPYTER_GETTING_STARTED_MARKDOWN,
    },
  },
];
frontend/src/__tests__/cypress/cypress/pages/components/JupyterCard.ts (1)

19-19: Correctly updated selector text to match new display name.

The text selector properly reflects the updated displayName from the mock data.

Consider whether the class name JupyterCard should be updated to reflect the new display name, or add a comment explaining that it still represents the same component despite the name change:

+// Note: Class name retained as JupyterCard for backwards compatibility,
+// even though display name changed to "Start basic workbench"
export class JupyterCard extends Card {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e94b20f and 004f64a.

📒 Files selected for processing (4)
  • frontend/src/__mocks__/mockComponents.ts (1 hunks)
  • frontend/src/__tests__/cypress/cypress/pages/components/JupyterCard.ts (1 hunks)
  • frontend/src/__tests__/cypress/cypress/tests/mocked/applications/enabled.cy.ts (1 hunks)
  • frontend/src/__tests__/cypress/cypress/tests/mocked/applications/explore.cy.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
frontend/src/__tests__/cypress/cypress/tests/mocked/applications/enabled.cy.ts (1)
Learnt from: christianvogt
PR: opendatahub-io/odh-dashboard#4381
File: frontend/src/__tests__/cypress/tsconfig.json:9-9
Timestamp: 2025-06-19T20:38:32.485Z
Learning: In the ODH Dashboard project, the `frontend/src/__tests__/cypress/tsconfig.json` file intentionally has an empty `files` array to disable type checking for Cypress test files. This is part of the monorepo structure where Cypress was separated into its own package but type checking is deliberately disabled for it.
frontend/src/__tests__/cypress/cypress/pages/components/JupyterCard.ts (1)
Learnt from: christianvogt
PR: opendatahub-io/odh-dashboard#4381
File: frontend/src/__tests__/cypress/tsconfig.json:9-9
Timestamp: 2025-06-19T20:38:32.485Z
Learning: In the ODH Dashboard project, the `frontend/src/__tests__/cypress/tsconfig.json` file intentionally has an empty `files` array to disable type checking for Cypress test files. This is part of the monorepo structure where Cypress was separated into its own package but type checking is deliberately disabled for it.
frontend/src/__tests__/cypress/cypress/tests/mocked/applications/explore.cy.ts (1)
Learnt from: christianvogt
PR: opendatahub-io/odh-dashboard#4381
File: frontend/src/__tests__/cypress/tsconfig.json:9-9
Timestamp: 2025-06-19T20:38:32.485Z
Learning: In the ODH Dashboard project, the `frontend/src/__tests__/cypress/tsconfig.json` file intentionally has an empty `files` array to disable type checking for Cypress test files. This is part of the monorepo structure where Cypress was separated into its own package but type checking is deliberately disabled for it.
frontend/src/__mocks__/mockComponents.ts (1)
Learnt from: christianvogt
PR: opendatahub-io/odh-dashboard#4381
File: frontend/src/__tests__/cypress/tsconfig.json:9-9
Timestamp: 2025-06-19T20:38:32.485Z
Learning: In the ODH Dashboard project, the `frontend/src/__tests__/cypress/tsconfig.json` file intentionally has an empty `files` array to disable type checking for Cypress test files. This is part of the monorepo structure where Cypress was separated into its own package but type checking is deliberately disabled for it.
🧬 Code Graph Analysis (1)
frontend/src/__tests__/cypress/cypress/tests/mocked/applications/explore.cy.ts (1)
frontend/src/__tests__/cypress/cypress/pages/components/JupyterCard.ts (1)
  • jupyterCard (24-24)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Cypress-Setup
  • GitHub Check: Lint
🔇 Additional comments (3)
frontend/src/__mocks__/mockComponents.ts (1)

18-31: Good approach for provider filter testing.

The changes to split the jupyter entry and clear the provider field support the stated objective of fixing provider filter functionality. The empty provider field for "Start basic workbench" creates a good test case for components without providers.

frontend/src/__tests__/cypress/cypress/tests/mocked/applications/enabled.cy.ts (1)

16-16: Correctly updated to match mock data changes.

The assertion update properly reflects the new displayName value from the mock data, maintaining test accuracy.

frontend/src/__tests__/cypress/cypress/tests/mocked/applications/explore.cy.ts (1)

11-13: Test updates consistently reflect the mock data changes.

Both the test name and assertion have been properly updated to match the new displayName value, maintaining test accuracy and readability.

Copy link

codecov bot commented Jul 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.61%. Comparing base (8d94660) to head (d060a91).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4443      +/-   ##
==========================================
- Coverage   82.61%   82.61%   -0.01%     
==========================================
  Files        1756     1756              
  Lines       36696    36697       +1     
  Branches    10859    10860       +1     
==========================================
- Hits        30318    30316       -2     
- Misses       6378     6381       +3     
Files with missing lines Coverage Δ
...rontend/src/pages/learningCenter/useDocFilterer.ts 100.00% <100.00%> (ø)

... and 13 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d94660...d060a91. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rsun19 rsun19 changed the title fixed provider filter in resources [wip] fixed provider filter in resources Jul 3, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress This PR is in WIP state label Jul 3, 2025
@rsun19 rsun19 changed the title [wip] fixed provider filter in resources fixed provider filter in resources Jul 7, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress This PR is in WIP state label Jul 7, 2025
Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

Works great!
/lgtm

Copy link
Contributor

openshift-ci bot commented Jul 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DaoDaoNoCode

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Jul 7, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit b518dcb into opendatahub-io:main Jul 7, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants