@@ -517,6 +517,68 @@ class DevInfoViewControllerTests: XCTestCase {
517517 XCTAssertEqual ( view. sections [ 2 ] . rows [ 2 ] . headline, " Scopes " )
518518 XCTAssertEqual ( view. sections [ 2 ] . rows [ 2 ] . text, " api web refresh_token " )
519519 }
520+
521+ // MARK: - App Attestation section tests
522+
523+ func testAppAttestationSection_DisabledNoUser( ) {
524+ let infoData = [
525+ " section:App Attestation " ,
526+ " Attestation Enabled " , " NO " ,
527+ " Used in Last Auth " , " N/A "
528+ ]
529+ let sections = DevInfoView . testExtractSections ( from: infoData)
530+
531+ XCTAssertEqual ( sections. count, 1 )
532+ let rows = sections [ 0 ] . rows
533+ XCTAssertEqual ( sections [ 0 ] . title, " App Attestation " )
534+ XCTAssertEqual ( rows. first ( where: { $0. headline == " Attestation Enabled " } ) ? . text, " NO " )
535+ XCTAssertEqual ( rows. first ( where: { $0. headline == " Used in Last Auth " } ) ? . text, " N/A " )
536+ }
537+
538+ func testAppAttestationSection_DisabledWithUser_NoFlag( ) {
539+ let infoData = [
540+ " section:App Attestation " ,
541+ " Attestation Enabled " , " NO " ,
542+ " Used in Last Auth " , " NO "
543+ ]
544+ let sections = DevInfoView . testExtractSections ( from: infoData)
545+
546+ XCTAssertEqual ( sections. count, 1 )
547+ let rows = sections [ 0 ] . rows
548+ XCTAssertEqual ( rows. first ( where: { $0. headline == " Attestation Enabled " } ) ? . text, " NO " )
549+ XCTAssertEqual ( rows. first ( where: { $0. headline == " Used in Last Auth " } ) ? . text, " NO " )
550+ }
551+
552+ func testAppAttestationSection_EnabledWithFeatureFlag( ) {
553+ let infoData = [
554+ " section:App Attestation " ,
555+ " Attestation Enabled " , " YES " ,
556+ " Used in Last Auth " , " YES "
557+ ]
558+ let sections = DevInfoView . testExtractSections ( from: infoData)
559+
560+ XCTAssertEqual ( sections. count, 1 )
561+ let rows = sections [ 0 ] . rows
562+ XCTAssertEqual ( rows. first ( where: { $0. headline == " Attestation Enabled " } ) ? . text, " YES " )
563+ XCTAssertEqual ( rows. first ( where: { $0. headline == " Used in Last Auth " } ) ? . text, " YES " )
564+ }
565+
566+ func testAppAttestationSection_AppearsAfterRtrSection( ) {
567+ let infoData = [
568+ " section:RTR " ,
569+ " RTR Active " , " NO " ,
570+ " Last Rotation " , " Never " ,
571+ " section:App Attestation " ,
572+ " Attestation Enabled " , " NO " ,
573+ " Used in Last Auth " , " N/A "
574+ ]
575+ let sections = DevInfoView . testExtractSections ( from: infoData)
576+
577+ XCTAssertEqual ( sections. count, 2 )
578+ XCTAssertEqual ( sections [ 0 ] . title, " RTR " )
579+ XCTAssertEqual ( sections [ 1 ] . title, " App Attestation " )
580+ XCTAssertEqual ( sections [ 1 ] . rows. count, 2 )
581+ }
520582}
521583
522584// MARK: - Test Helper Extension
0 commit comments