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

Closed
rigtigeEmil opened this issue Nov 24, 2024 · 1 comment
Closed

Allow setting data attributes on nested elements #2746

rigtigeEmil opened this issue Nov 24, 2024 · 1 comment
Labels
enhancement New feature or request triage v3 #1289

Comments

@rigtigeEmil
Copy link
Contributor

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
@benjamincanac benjamincanac added the v3 #1289 label Dec 16, 2024
@benjamincanac
Copy link
Member

Would you mind being more specific, on which component do you want to add those attributes? 🤔

@benjamincanac benjamincanac closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2025
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 v3 #1289
Projects
None yet
Development

No branches or pull requests

2 participants