@@ -316,6 +316,30 @@ describe('onINP()', async function() {
316316 assert . strictEqual ( beacons . length , 0 ) ;
317317 } ) ;
318318
319+ it ( 'reports restore as nav type for wasDiscarded' , async function ( ) {
320+ if ( ! browserSupportsINP ) this . skip ( ) ;
321+
322+ await browser . url ( '/test/inp?click=100&wasDiscarded=1' ) ;
323+
324+ const h1 = await $ ( 'h1' ) ;
325+ await h1 . click ( ) ;
326+
327+ await stubVisibilityChange ( 'hidden' ) ;
328+
329+ await beaconCountIs ( 1 ) ;
330+
331+ const [ inp ] = await getBeacons ( ) ;
332+ assert ( inp . value >= 0 ) ;
333+ assert ( inp . id . match ( / ^ v 3 - \d + - \d + $ / ) ) ;
334+ assert . strictEqual ( inp . name , 'INP' ) ;
335+ assert . strictEqual ( inp . value , inp . delta ) ;
336+ assert . strictEqual ( inp . rating , 'good' ) ;
337+ assert ( containsEntry ( inp . entries , 'click' , 'h1' ) ) ;
338+ assert ( interactionIDsMatch ( inp . entries ) ) ;
339+ assert ( inp . entries [ 0 ] . interactionId > 0 ) ;
340+ assert . strictEqual ( inp . navigationType , 'restore' ) ;
341+ } ) ;
342+
319343 describe ( 'attribution' , function ( ) {
320344 it ( 'includes attribution data on the metric object' , async function ( ) {
321345 if ( ! browserSupportsINP ) this . skip ( ) ;
0 commit comments