-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a57734c
commit c44800f
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import '@testing-library/jest-dom'; | ||
import { render } from '@testing-library/react'; | ||
import React from 'react'; | ||
|
||
// TestComponent renders a button with the styles we want to test. | ||
const TestComponent = () => { | ||
return ( | ||
<button | ||
className="introjs-skipbutton" | ||
// Applying styles inline to ensure they are available during the test | ||
style={{ | ||
fontSize: '1.0em', | ||
left: 'auto', | ||
right: '10px', | ||
color: '#555', | ||
}} | ||
> | ||
Skip | ||
</button> | ||
); | ||
}; | ||
|
||
// Test to verify that the .introjs-skipbutton styles are applied correctly | ||
test('renders .introjs-skipbutton with correct styles', () => { | ||
// Render the TestComponent | ||
const { getByText } = render(<TestComponent />); | ||
|
||
// Select the button element by its text content | ||
const skipButton = getByText('Skip'); | ||
|
||
// Assertions to verify that each style is applied as expected | ||
expect(skipButton).toHaveStyle('font-size: 1.0em'); // Check font size | ||
expect(skipButton).toHaveStyle('left: auto'); // Check left alignment | ||
expect(skipButton).toHaveStyle('right: 10px'); // Check right position | ||
expect(skipButton).toHaveStyle('color: #555'); // Check text color | ||
}); |
Empty file.