@@ -148,7 +148,7 @@ describe('features/unified-share-modal/SharedLinkSection', () => {
148148 expect ( wrapper ) . toMatchSnapshot ( ) ;
149149 } ) ;
150150
151- test ( 'should account for shared link expirations being set' , ( ) => {
151+ test ( 'should match snapshot when shared link expiration is set' , ( ) => {
152152 const wrapper = getWrapper ( {
153153 sharedLink : {
154154 accessLevel : 'peopleInYourCompany' ,
@@ -310,6 +310,22 @@ describe('features/unified-share-modal/SharedLinkSection', () => {
310310 expect ( wrapper . exists ( '.email-shared-link-btn' ) ) . toBe ( emailButtonExists ) ;
311311 } ) ;
312312
313+ test ( 'should have aria-label and role on shared link expiration badge when expiration timestamp exists' , ( ) => {
314+ // Set an expiration timestamp so that Toggle is rendered with expiration icon
315+ const sharedLink = {
316+ expirationTimestamp : 1 ,
317+ url : 'https://example.com/shared-link' ,
318+ } ;
319+ const wrapper = getWrapper ( { sharedLink } ) ;
320+ const toggle = wrapper . find ( 'Toggle' ) ;
321+
322+ // The aria-label attr is on a span, which is contained within the label of the Toggle component
323+ const spanLabel = toggle . dive ( ) . find ( '.shared-link-expiration-badge' ) ;
324+
325+ expect ( spanLabel . prop ( 'aria-label' ) ) . toBe ( 'Expires' ) ;
326+ expect ( spanLabel . prop ( 'role' ) ) . toBe ( 'img' ) ;
327+ } ) ;
328+
313329 describe ( 'componentDidMount()' , ( ) => {
314330 test ( 'should attempt shared link creation when component is mounted with initial, empty shared link data' , ( ) => {
315331 const sharedLink = { url : '' , isNewSharedLink : false } ;
0 commit comments