This pull request introduces unit tests for four different components:
ToggleComponent, IntComponent, FloatComponent, and InputComponent. The
tests ensure that these components function as expected and help
maintain code quality.
Changes Made:
Added a test suite for ToggleComponent to verify its functionality.
Added a test suite for IntComponent to verify its functionality.
Added a test suite for FloatComponent to verify its functionality.
Added a test suite for InputComponent to verify its functionality.
The toggleComponent.spec.ts file contains a test case that verifies the functionality of the ToggleComponent. The test case performs the following actions:
1. Routes network requests from a HAR file, disabling updates for URLs matching "**/api/v1/**".
2. Routes a specific network request to return a JSON response with a status of 201.
3. Navigates to "http://localhost:3000/".
4. Waits for 2000 milliseconds.
5. Clicks on an element with the id "new-project-btn".
6. Waits for 2000 milliseconds.
7. Clicks on an element with the placeholder text "Search" and fills it with "directoryLoader".
8. Waits for 2000 milliseconds.
9. Drags an element with the id "sideDirectoryLoader" to another element with the id "react-flow-id".
10. Performs a series of click actions on various elements to test their functionality.
11. Verifies the state of toggle buttons using the isChecked() method.
12. Clicks on an element with the id "saveChangesBtn".
13. Performs additional click actions and verifications.
14. Clicks on an element with the id "saveChangesBtn".
15. Performs additional click actions and verifications.
16. Clicks on an element with the id "saveChangesBtn".
17. Performs additional click actions and verifications.
18. Clicks on an element with the id "saveChangesBtn".
19. Performs additional click actions and verifications.
20. Clicks on an element with the id "saveChangesBtn".
21. Performs additional click actions and verifications.
22. Verifies the count of elements matching the locator "//*[@id="toggle-1"]" and performs additional actions based on the count.
This test case is added to ensure that the ToggleComponent functions as expected and that the toggle buttons behave correctly.
test(dragAndDrop.spec.ts): add support for drag and drop functionality to test dropping a collection
test(dragAndDrop.spec.ts): add support for drag and drop functionality to test dropping a flow
The `dragAndDrop.spec.ts` file was added to the `src/frontend/tests/onlyFront` directory. This file contains tests for the auto_login functionality. Two tests were added:
1. `auto_login sign in`: This test simulates signing in with auto_login. It routes requests from the "langflow.har" file to the appropriate API endpoints, navigates to the homepage, clicks on the "Community Examples" button, waits for the ".community-pages-flows-panel" selector to be present, and asserts that it has children.
2. `auto_login block_admin`: This test simulates accessing the admin section with auto_login. It routes requests from the "langflow.har" file to the appropriate API endpoints, navigates to the homepage, clicks on the "Community Examples" button, navigates to the login page, clicks on the "Community Examples" button again, navigates to the admin page, clicks on the "Community Examples" button again, navigates to the admin login page, and clicks on the "Community Examples" button.
These tests were added to ensure the proper functioning of the auto_login feature.
feat(tabsContext.tsx): change the order of arguments in addFlow function call to improve readability
feat(exportModal/index.tsx): add alertContext and setNoticeData to display a warning when saving a file with API keys
feat(exportModal/index.tsx): add a caution message to inform users about the consequences of saving with API keys
🔥 chore(field_typing): remove unused base.py file as it is no longer needed
🔀 chore(constants): update import statements and add type aliases for better readability and maintainability
🔧 fix(custom_component.py): fix argument type in return statement of CustomComponent.get_args()
🔧 fix(custom_components.py): make description attribute optional in CustomComponentFrontendNode class
🔀 chore(field_typing): add support for Data type in field_typing/base.py
🔀 chore(field_typing): add constants.py file to define supported types in field_typing
🔀 chore(interface/custom): remove duplicate imports and use field_typing types
🔀 chore(utils): fix syntax error in get_base_classes function
The code in the codeAreaModal component has been formatted to improve readability. Additionally, class names have been added to the Input component to position it correctly on the page.
fix(codeAreaComponent): add id prop to Input component for accessibility and testing purposes
fix(promptComponent): add id prop to GenericModal and span elements for accessibility and testing purposes
fix(textAreaComponent): add id prop to Input component for accessibility and testing purposes
fix(EditNodeModal): add unique id to textarea and input components for accessibility and testing purposes
fix(codeAreaModal): add id prop to Input component for accessibility and testing purposes
fix(genericModal): add id prop to GenericModal and span elements for accessibility and testing purposes
fix(components/types): add id prop to component types for consistency and future use
feat(tests): add tests for CodeAreaModalComponent and PromptTemplateComponent