@@ -99,9 +99,7 @@ describe('IntroQuestButton', () => {
9999 openModal,
100100 } ) ;
101101 mockUseActions . mockReturnValue ( {
102- checkHasCompleted : jest . fn (
103- ( type : ActionType ) => type !== ActionType . ViewedIntroQuests ,
104- ) ,
102+ checkHasCompleted : jest . fn ( ( ) => false ) ,
105103 } ) ;
106104 mockUseViewSize . mockImplementation ( ( size ) => size === ViewSize . Laptop ) ;
107105 mockUseConditionalFeature . mockReturnValue ( { value : true } ) ;
@@ -248,14 +246,14 @@ describe('IntroQuestButton', () => {
248246 buildIntroQuest ( {
249247 rotationId : 'rot-1' ,
250248 status : QuestStatus . Claimed ,
251- completedAt : '2026-05-03T10:00:00.000Z' ,
252- claimedAt : '2026-05-03T10:05:00.000Z' ,
249+ completedAt : new Date ( '2026-05-03T10:00:00.000Z' ) ,
250+ claimedAt : new Date ( '2026-05-03T10:05:00.000Z' ) ,
253251 } ) ,
254252 buildIntroQuest ( {
255253 rotationId : 'rot-2' ,
256254 status : QuestStatus . Claimed ,
257- completedAt : '2026-05-03T10:10:00.000Z' ,
258- claimedAt : '2026-05-03T10:15:00.000Z' ,
255+ completedAt : new Date ( '2026-05-03T10:10:00.000Z' ) ,
256+ claimedAt : new Date ( '2026-05-03T10:15:00.000Z' ) ,
259257 } ) ,
260258 ] ,
261259 } ,
@@ -267,4 +265,18 @@ describe('IntroQuestButton', () => {
267265 screen . queryByRole ( 'button' , { name : / O p e n i n t r o d u c t i o n q u e s t s / } ) ,
268266 ) . not . toBeInTheDocument ( ) ;
269267 } ) ;
268+
269+ it ( 'does not render when intro quests have been permanently hidden' , ( ) => {
270+ mockUseActions . mockReturnValue ( {
271+ checkHasCompleted : jest . fn (
272+ ( type : ActionType ) => type === ActionType . IntroQuestsCompleted ,
273+ ) ,
274+ } ) ;
275+
276+ render ( < IntroQuestButton /> ) ;
277+
278+ expect (
279+ screen . queryByRole ( 'button' , { name : / O p e n i n t r o d u c t i o n q u e s t s / } ) ,
280+ ) . not . toBeInTheDocument ( ) ;
281+ } ) ;
270282} ) ;
0 commit comments