Does the test folder have a library.json in it? What’s its content? PlatformIO has logic which tries to dynamically look for the actual root of the project, by locating either its manifest file (library.json) or the first folder containing code. Can you post a tree structure of the folder? Without that info it’s very hard to say anything else than very generic things o_o.
A library is usually of the format as described in here and library.json, your library has… a platformio.ini? That’s a firmware project then. Usually a library just has the library code and example sketches in examples, projects that use the libraries are outside of it otherwise. Take a look at say, ArduinoJson.