fix: improve vector store test (#5121)

* 📝 (.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.
This commit is contained in:
Cristhian Zanforlin Lousa 2024-12-06 13:33:47 -03:00 committed by GitHub
commit 6d83bc13b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 13 deletions

View file

@ -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/**"

View file

@ -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 &&

View file

@ -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",

View file

@ -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"),
@ -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,