quivr icon indicating copy to clipboard operation
quivr copied to clipboard

[FRONT - TEST] Add tests to frontend/explore/*

Open mamadoudicko opened this issue 1 year ago • 1 comments

mamadoudicko avatar Jun 30 '23 09:06 mamadoudicko

To create a test, follow these steps:

  1. Navigate to the relevant page and create or update a file with the name __tests__/<XXXXX>.test.ts.

  2. To run the test, execute the command yarn test-unit.

For an example of how this is done, you can refer to the following link: https://github.com/StanGirard/quivr/pull/426

Have fun!

mamadoudicko avatar Jun 30 '23 09:06 mamadoudicko

I cant view my docx document in /explore/ (im using Firefox) Error in console

Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bbrain_id%2C%20vector_id%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

GorlikItsMe avatar Jul 19 '23 08:07 GorlikItsMe

Here is quick fix that might help with this:

--- a/frontend/app/explore/DocumentItem/DocumentData.tsx
+++ b/frontend/app/explore/DocumentItem/DocumentData.tsx
@@ -50,7 +50,7 @@ const DocumentData = ({ documentName }: DocumentDataProps): JSX.Element => {
                   {doc.replaceAll("_", " ")}
                 </p>
                 <span className="break-words my-auto">
-                  {documents[0][doc] || "Not Available"}
+                  {JSON.stringify(documents[0][doc]) || "Not Available"}
                 </span>
               </div>
             );

Reason for error is that document has "Brains Vectors" key which is array of objects and not a plain text field.

ilkkanisula avatar Jul 22 '23 20:07 ilkkanisula

@GorlikItsMe @ilkkanisula this was fixed in https://github.com/StanGirard/quivr/pull/781

cpsoinos avatar Jul 31 '23 16:07 cpsoinos