React Testing Library
// Bad
expect(
screen
.getByRole("img", {
name: /Pague 11 lleve 12 en jabón supremo 300g/i
})
.closest("a") // Avoid direct node access
).toHaveAttribute("href", "/promo-detail/C-6912");
// Good
expect(
screen
.getByRole("link", {
name: /Pague 11 lleve 12 en jabón supremo 300g/i
})
).toHaveAttribute("href", "/promo-detail/C-6912");
Evite el acceso directo al node. Prefiero usar los métodos de Testing Library
Continuous Integration - Jenkins
Pipeline Jenkins
That's all folks!