Add extra tests

This commit is contained in:
Adria Navarro 2023-11-20 13:34:10 +01:00
parent 2e4cf53d05
commit d8590caa24
1 changed files with 34 additions and 0 deletions

View File

@ -168,6 +168,40 @@ describe("datasourceUtils", () => {
}),
])
})
it("given a non matching search term, all entities are empty", () => {
const searchTerm = "non matching"
const result = enrichDatasources(
datasources,
{},
isActive,
"",
{ list: [] },
{ list: [] },
{ list: [] },
{},
searchTerm
)
expect(result).toEqual([
expect.objectContaining({
_id: internalTables._id,
show: false,
tables: [],
}),
expect.objectContaining({
_id: pgDatasource._id,
show: false,
tables: [],
}),
expect.objectContaining({
_id: mysqlDatasource._id,
show: false,
tables: [],
}),
])
})
})
})
})