Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting data attributes on nested elements #2746

Open
rigtigeEmil opened this issue Nov 24, 2024 · 0 comments
Open

Allow setting data attributes on nested elements #2746

rigtigeEmil opened this issue Nov 24, 2024 · 0 comments
Labels
enhancement New feature or request triage

Comments

@rigtigeEmil
Copy link

For what version of Nuxt UI are you suggesting this?

v3.0.0-alpha.x

Description

Hey. I'd like to be able to write a simple test, validating that an input field is required and shows correct validation message. Might look something like this:

describe('login page', async () => {
	await setup();
	it('requires the email field', async () => {
		const page = await createPage('/sign-in');
		await page.getByTestId('sign-in').click();
		expect(await page.getByTestId('email-error').isVisible()).toBe(true);
	});
});

It does not seem to be possible to add data attributes, in this case, email-error to the error message that appears on failed form validation.
This is obviously just an example, but I'm sure it'd be useful on many other components.

Additional context

No response

@rigtigeEmil rigtigeEmil added enhancement New feature or request triage labels Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage
Projects
None yet
Development

No branches or pull requests

1 participant