Skip to content

Commit 1fa94a4

Browse files
arbrandesclaude
andcommitted
fix: update tests for link role after href change
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 205cc6b commit 1fa94a4

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/containers/CourseCard/components/CourseCardActions/BeginCourseButton.test.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,22 @@ describe('BeginCourseButton', () => {
6363
it('should be disabled', () => {
6464
useActionDisabledState.mockReturnValueOnce({ disableBeginCourse: true });
6565
renderComponent();
66-
const button = screen.getByRole('button', { name: 'Begin Course' });
66+
const button = screen.getByRole('link', { name: 'Begin Course' });
6767
expect(button).toHaveClass('disabled');
6868
expect(button).toHaveAttribute('aria-disabled', 'true');
6969
});
7070
});
7171
describe('enabled', () => {
7272
it('should be enabled', () => {
7373
renderComponent();
74-
const button = screen.getByRole('button', { name: 'Begin Course' });
74+
const button = screen.getByRole('link', { name: 'Begin Course' });
7575
expect(button).not.toHaveClass('disabled');
7676
expect(button).not.toHaveAttribute('aria-disabled', 'true');
7777
});
7878
it('should track enter course clicked event on click, with exec ed param', () => {
7979
renderComponent();
8080
const user = userEvent.setup();
81-
const button = screen.getByRole('button', { name: 'Begin Course' });
81+
const button = screen.getByRole('link', { name: 'Begin Course' });
8282
user.click(button);
8383
expect(useCourseTrackingEvent).toHaveBeenCalledWith(
8484
track.course.enterCourseClicked,

src/containers/CourseCard/components/CourseCardActions/ResumeButton.test.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,23 @@ describe('ResumeButton', () => {
6363
});
6464
it('should be disabled', () => {
6565
render(<IntlProvider locale="en"><ResumeButton {...props} /></IntlProvider>);
66-
const button = screen.getByRole('button', { name: 'Resume' });
66+
const button = screen.getByRole('link', { name: 'Resume' });
6767
expect(button).toHaveClass('disabled');
6868
expect(button).toHaveAttribute('aria-disabled', 'true');
6969
});
7070
});
7171
describe('enabled', () => {
7272
it('should be enabled', () => {
7373
render(<IntlProvider locale="en"><ResumeButton {...props} /></IntlProvider>);
74-
const button = screen.getByRole('button', { name: 'Resume' });
74+
const button = screen.getByRole('link', { name: 'Resume' });
7575
expect(button).toBeInTheDocument();
7676
expect(button).not.toHaveClass('disabled');
7777
expect(button).not.toHaveAttribute('aria-disabled', 'true');
7878
});
7979
it('should track enter course clicked event on click, with exec ed param', async () => {
8080
render(<IntlProvider locale="en"><ResumeButton {...props} /></IntlProvider>);
8181
const user = userEvent.setup();
82-
const button = screen.getByRole('button', { name: 'Resume' });
82+
const button = screen.getByRole('link', { name: 'Resume' });
8383
user.click(button);
8484
expect(useCourseTrackingEvent).toHaveBeenCalledWith(
8585
track.course.enterCourseClicked,

src/containers/CourseCard/components/CourseCardActions/ViewCourseButton.test.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const homeUrl = 'homeUrl';
3232
describe('ViewCourseButton', () => {
3333
it('learner can view course', async () => {
3434
render(<IntlProvider locale="en"><ViewCourseButton {...defaultProps} /></IntlProvider>);
35-
const button = screen.getByRole('button', { name: 'View Course' });
35+
const button = screen.getByRole('link', { name: 'View Course' });
3636
expect(button).toBeInTheDocument();
3737
expect(button).not.toHaveClass('disabled');
3838
expect(button).not.toHaveAttribute('aria-disabled', 'true');
@@ -42,7 +42,7 @@ describe('ViewCourseButton', () => {
4242
useCourseTrackingEvent.mockReturnValue(mockedTrackCourseEvent);
4343
render(<IntlProvider locale="en"><ViewCourseButton {...defaultProps} /></IntlProvider>);
4444
const user = userEvent.setup();
45-
const button = screen.getByRole('button', { name: 'View Course' });
45+
const button = screen.getByRole('link', { name: 'View Course' });
4646
await user.click(button);
4747
expect(useCourseTrackingEvent).toHaveBeenCalledWith(
4848
track.course.enterCourseClicked,
@@ -54,7 +54,7 @@ describe('ViewCourseButton', () => {
5454
it('learner cannot view course', () => {
5555
useActionDisabledState.mockReturnValueOnce({ disableViewCourse: true });
5656
render(<IntlProvider locale="en"><ViewCourseButton {...defaultProps} /></IntlProvider>);
57-
const button = screen.getByRole('button', { name: 'View Course' });
57+
const button = screen.getByRole('link', { name: 'View Course' });
5858
expect(button).toHaveClass('disabled');
5959
expect(button).toHaveAttribute('aria-disabled', 'true');
6060
});

0 commit comments

Comments
 (0)