Skip to content

Commit

Permalink
fix: improve vector store test (#5121)
Browse files Browse the repository at this point in the history
* πŸ“ (.github/changes-filter.yaml): Add new path to starter-projects test category
πŸ”§ (index.tsx, inputFileComponent): Add data-testid attribute to input element for testing purposes
πŸ”§ (index.tsx, popover): Increase padding-right value for password input field
πŸ”§ (Vector Store.spec.ts): Update test to click on correct element with data-testid attribute for file upload
πŸ”§ (Vector Store.spec.ts): Remove redundant code related to filling input field and clicking on button

* πŸ”§ (index.tsx): Update styles for inputComponent popover to improve layout and alignment.
  • Loading branch information
Cristhianzl authored Dec 6, 2024
1 parent 79b03ba commit 6d83bc1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/changes-filter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ docs:
# Test categories and their associated paths
starter-projects:
- "src/backend/base/langflow/initial_setup/**"
- "src/backend/base/langflow/components/**"
- "src/frontend/src/pages/MainPage/**"
- "src/frontend/src/utils/reactflowUtils.ts"
- "src/frontend/tests/extended/features/**"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const CustomInputPopover = ({
disabled={disabled}
required={required}
className={cn(
"popover-input nodrag truncate px-1 pr-4",
"popover-input nodrag w-full truncate px-1 pr-4",
editNode && "px-2",
editNode && disabled && "h-fit w-fit",
disabled &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export default function InputFileComponent({
<div className="relative flex w-full">
<div className="w-full">
<input
data-testid="input-file-component"
type="text"
className={cn(
"primary-input h-9 w-full cursor-pointer rounded-r-none text-sm focus:border-border focus:outline-none focus:ring-0",
Expand Down
14 changes: 2 additions & 12 deletions src/frontend/tests/core/integrations/Vector Store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,8 @@ test(
.nth(1)
.fill(process.env.ASTRA_DB_API_ENDPOINT ?? "");

await page
.getByTestId("popover-anchor-input-collection_name")
.nth(0)
.fill("test");
const fileChooserPromise = page.waitForEvent("filechooser");
await page.getByTestId("icon-Upload").last().click();
await page.getByTestId("input-file-component").last().click();
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles(
path.join(__dirname, "../../assets/test_file.txt"),
Expand All @@ -155,13 +151,7 @@ test(
await page.getByText("built successfully").last().click({
timeout: 30000,
});
await page.getByTestId("button_run_astra db").first().click();
await page.waitForSelector("text=built successfully", {
timeout: 60000 * 2,
});
await page.getByText("built successfully").last().click({
timeout: 30000,
});

await page.getByText("Playground", { exact: true }).last().click();
await page.waitForSelector('[data-testid="input-chat-playground"]', {
timeout: 100000,
Expand Down

0 comments on commit 6d83bc1

Please sign in to comment.