/* Ċ Ġ* ĠCopyright Ġ 2 0 2 1 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġandroidx . compose . ui . inspection Ċ Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . compose . ui . inspection . rules . Compose Inspection Rule Ċ import Ġandroidx . compose . ui . inspection . rules . send Command Ċ import Ġandroidx . compose . ui . inspection . testdata . Android View Test Activity Ċ import Ġandroidx . compose . ui . inspection . util . Get Comp os ables Command Ċ import Ġandroidx . compose . ui . inspection . util . flatten Ċ import Ġandroidx . compose . ui . inspection . util . toMap Ċ import Ġandroidx . test . filters . Large Test Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ Ċ @ Large Test Ċ class ĠAndroid View Test Ġ{ ĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġval Ġrule Ġ= ĠCompose Inspection Rule ( Android View Test Activity :: class ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġandroid View (): ĠUnit Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġapp Ġ= Ġrule . inspector Tester . send Command ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠGet Comp os ables Command ( rule . root Id , Ġskip System Comp os ables Ġ= Ġfalse ) ĊĠĠĠĠĠĠĠ Ġ). get Comp os ables Response ĊĠĠĠĠĠĠĠ Ġval Ġstrings Ġ= Ġapp . strings List . toMap () ĊĠĠĠĠĠĠĠ Ġval Ġcompose Node Ġ= Ġapp . roots List . flatMap Ġ{ Ġit . nodes List Ġ}. flatMap Ġ{ Ġit . flatten () Ġ}. filter Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . view Id Ġ!= Ġ 0 L ĊĠĠĠĠĠĠĠ Ġ}. single () ĊĠĠĠĠĠĠĠ ĠassertThat ( strings [ compose Node . name ]). isEqualTo (" Compose Node ") ĊĠĠĠĠĠĠĠ Ġval ĠviewHolder Ġ= Ġ( rule . roots For Test . single () Ġas ĠViewGroup ). getChild At ( 0 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( compose Node . view Id ). isEqualTo ( view Holder . unique Drawing Id ) ĊĠĠĠ Ġ} Ċ } Ċ