How to get the value of H1 tag and test it using Jest and RTL

I’m trying to test my component if it displays the right value in my h1. Below is my component that will be tested. const Title = () => { return ( <>

(function ($) { $('.afc_close_content').click(function(){ var afc_content_id = $(this).closest('div').attr('id'); $('#'+afc_content_id).hide(); }); })(jQuery);