packagemanagermanager tests passing

This commit is contained in:
Smartsheet-JB-Brown 2025-04-14 17:13:26 -07:00
parent e1c590442c
commit 72d9be2a6c

View file

@ -367,7 +367,7 @@ describe("PackageManagerManager", () => {
// This test was skipped because it depends on the actual content of the package-manager-template
// which may change over time
it.skip("should find data validator in package-manager-template", async () => {
it("should find data validator in package-manager-template", async () => {
// Load real data from the template
const templatePath = path.resolve(__dirname, "../../../../package-manager-template")
const scanner = new MetadataScanner()
@ -599,59 +599,4 @@ describe("filterItems with real data", () => {
},
})
})
// This test was skipped because it depends on the actual content of the package-manager-template
// which may change over time
it.skip("should find data validator in package-manager-template", async () => {
// Load real data from the template
const templatePath = path.resolve(__dirname, "../../../../package-manager-template")
const scanner = new MetadataScanner()
const items = await scanner.scanDirectory(templatePath, "https://example.com")
// Test 1: Search for "data validator" (lowercase)
const filtered1 = manager.filterItems(items, { search: "data validator" })
console.log("Test 1 - Search for 'data validator'")
console.log("Filtered items count:", filtered1.length)
// Verify we find the Data Validator component
expect(filtered1.length).toBeGreaterThan(0)
// Find the Data Validator component in the filtered results
let foundDataValidator1 = false
for (const item of filtered1) {
if (item.items) {
for (const subItem of item.items) {
if (subItem.metadata?.name === "Data Validator") {
foundDataValidator1 = true
break
}
}
}
}
expect(foundDataValidator1).toBe(true)
// Test 2: Search for "DATA VALIDATOR" (uppercase)
const filtered2 = manager.filterItems(items, { search: "DATA VALIDATOR" })
console.log("\nTest 2 - Search for 'DATA VALIDATOR'")
console.log("Filtered items count:", filtered2.length)
// Verify we find the Data Validator component
expect(filtered2.length).toBeGreaterThan(0)
// Test 3: Search for "validator" (partial match)
const filtered3 = manager.filterItems(items, { search: "validator" })
console.log("\nTest 3 - Search for 'validator'")
console.log("Filtered items count:", filtered3.length)
// Verify we find the Data Validator component
expect(filtered3.length).toBeGreaterThan(0)
// Test 4: Search for "data valid" (partial match)
const filtered4 = manager.filterItems(items, { search: "data valid" })
console.log("\nTest 4 - Search for 'data valid'")
console.log("Filtered items count:", filtered4.length)
// Verify we find the Data Validator component
expect(filtered4.length).toBeGreaterThan(0)
})
})