File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed
courseware/course/sequence/sequence-navigation Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { sendTrackEvent } from '@edx/frontend-platform/analytics';
44import { useIntl } from '@edx/frontend-platform/i18n' ;
55
66import { MAIN_CONTENT_ID } from '@src/constants' ;
7+ import { useScrollToContent } from '@src/generic/hooks' ;
78import messages from './messages' ;
89import Timeline from './timeline/Timeline' ;
910
@@ -14,7 +15,6 @@ import SuggestedScheduleHeader from '../suggested-schedule-messaging/SuggestedSc
1415import ShiftDatesAlert from '../suggested-schedule-messaging/ShiftDatesAlert' ;
1516import UpgradeToCompleteAlert from '../suggested-schedule-messaging/UpgradeToCompleteAlert' ;
1617import UpgradeToShiftDatesAlert from '../suggested-schedule-messaging/UpgradeToShiftDatesAlert' ;
17- import { useScrollToContent } from '../../generic/hooks' ;
1818
1919const DatesTab = ( ) => {
2020 const intl = useIntl ( ) ;
Original file line number Diff line number Diff line change 99 waitFor ,
1010} from '../../../../setupTest' ;
1111import UnitButton from './UnitButton' ;
12+ import messages from './messages' ;
1213
1314describe ( 'Unit Button' , ( ) => {
1415 let mockData ;
@@ -112,7 +113,7 @@ describe('Unit Button', () => {
112113 const { container } = render (
113114 < >
114115 < UnitButton { ...mockData } />
115- < button id = "bookmark-button" type = "button" > Bookmark </ button >
116+ < button id = "bookmark-button" type = "button" > { messages . bookmark . defaultMessage } </ button >
116117 </ > ,
117118 { wrapWithRouter : true } ,
118119 ) ;
@@ -136,7 +137,7 @@ describe('Unit Button', () => {
136137 const { container } = render (
137138 < >
138139 < UnitButton { ...mockData } onClick = { onClick } />
139- < button id = "bookmark-button" type = "button" > Bookmark </ button >
140+ < button id = "bookmark-button" type = "button" > { messages . bookmark . defaultMessage } </ button >
140141 </ > ,
141142 { wrapWithRouter : true } ,
142143 ) ;
Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ const messages = defineMessages({
1616 defaultMessage : 'Previous' ,
1717 description : 'Button to return to the previous section' ,
1818 } ,
19+ bookmark : {
20+ id : 'learning.generic.bookmark' ,
21+ defaultMessage : 'Bookmark' ,
22+ description : 'Button text for bookmarking' ,
23+ } ,
1924} ) ;
2025
2126export default messages ;
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ describe('Hooks', () => {
6363 test ( 'should scroll to target element and focus' , async ( ) => {
6464 render ( < TestComponent /> ) ;
6565
66- const skipLink = screen . getByRole ( 'link' , { name : / s k i p t o c o n t e n t / i } ) ;
66+ const skipLink = screen . getByRole ( 'link' , { name : new RegExp ( messages . skipToContent . defaultMessage , 'i' ) } ) ;
6767 const targetContent = screen . getByTestId ( 'target-content' ) ;
6868
6969 targetContent . focus = jest . fn ( ) ;
@@ -114,7 +114,7 @@ describe('Hooks', () => {
114114
115115 render ( < ComponentWithoutTarget /> ) ;
116116
117- const skipLink = screen . getByRole ( 'link' , { name : / s k i p t o c o n t e n t / i } ) ;
117+ const skipLink = screen . getByRole ( 'link' , { name : new RegExp ( messages . skipToContent . defaultMessage , 'i' ) } ) ;
118118
119119 await userEvent . click ( skipLink ) ;
120120
You can’t perform that action at this time.
0 commit comments