diff --git a/src/App.test.tsx b/src/App.test.tsx index 0782bc3..907fbcc 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -267,5 +267,34 @@ describe('Supplier Portal Onboarding & Active Dashboard Tests', () => { globalThis.fetch = originalFetch }) + + it('allows login directly without entering any password', async () => { + render() + + const loginBtn = screen.getByText(/^Login$/i) + fireEvent.click(loginBtn) + + const submitBtn = screen.getByRole('button', { name: /Sign In/i }) + fireEvent.click(submitBtn) + + expect(await screen.findByText(/Total Sales/i)).toBeInTheDocument() + }) + + it('allows signup without entering any password', async () => { + render() + + const getStartedBtn = screen.getByText(/^Get started$/i) + fireEvent.click(getStartedBtn) + + fireEvent.change(screen.getByPlaceholderText(/Enter your email/i), { target: { value: 'artisan_nopass@tradhox.com' } }) + fireEvent.change(screen.getByPlaceholderText(/9876543210/i), { target: { value: '9876543210' } }) + fireEvent.click(screen.getByLabelText(/I agree to the/i)) + + const alertMock = vi.spyOn(window, 'alert').mockImplementation(() => {}) + fireEvent.click(screen.getByRole('button', { name: /Create Account/i })) + + expect(await screen.findByText(/Welcome to Tradhox/i)).toBeInTheDocument() + alertMock.mockRestore() + }) }) diff --git a/src/components/pages/AuthForms.tsx b/src/components/pages/AuthForms.tsx index dfa50d3..3bfafc7 100644 --- a/src/components/pages/AuthForms.tsx +++ b/src/components/pages/AuthForms.tsx @@ -150,10 +150,9 @@ export default function AuthForms() { setPassword(e.target.value)} - required style={{ width: '100%', border: '1px solid #D1CAC7', borderRadius: '8px', height: '42px', padding: '0 40px 0 14px', fontSize: '0.9rem', outline: 'none' }} />