Closed demetrius-mp closed 2 years ago
actually, if you prefer, it can also be solved the same way you did right here. jsut let me know, i could open another PR using your method.
just realized that using css to "disable" the link, gives this test error:
FAIL src/__test__/Button.spec.js
● Button › should render as link if href specified
expect(received).toBe(expected) // Object.is equality
Expected: "btn btn-secondary"
Received: "btn btn-secondary svelte-1orwa0"
68 | const container = renderButton({ href: 'http://example.com/' });
69 | const link = container.querySelector('a');
> 70 | expect(link.className).toBe('btn btn-secondary');
| ^
71 | expect(link.href).toBe('http://example.com/');
72 | });
73 |
going to try and solve this by eating the click event with js.
fixes #405 used this as solution. also, added type to the
colors: ButtonColor[]
array to remove vscode type warnings.