@@ -98,18 +98,66 @@ describe('VDisk state', () => {
9898 VDiskState = "OK" // severity 1, green
9999 Replicated = { true }
100100 />
101+ </ >
102+ ) ;
103+
104+ const [ disk1 , disk2 ] = getAllByRole ( 'meter' ) ;
105+
106+ expect ( disk1 . className ) . toMatch ( / _ b l u e \b / i) ;
107+ expect ( disk2 . className ) . not . toMatch ( / _ b l u e \b / i) ;
108+ } ) ;
109+
110+ it ( 'Should display replicating VDisks in a not-OK state with a regular color' , ( ) => {
111+ const { getAllByRole} = render (
112+ < >
101113 < VDisk
102- VDiskId = { { Domain : 3 } }
114+ VDiskId = { { Domain : 1 } }
103115 VDiskState = "Initial" // severity 3, yellow
104116 Replicated = { false }
117+ />
118+ < VDisk
119+ VDiskId = { { Domain : 2 } }
120+ VDiskState = "PDiskError" // severity 5, red
121+ Replicated = { false }
122+ />
123+ </ >
124+ ) ;
125+
126+ const [ disk1 , disk2 ] = getAllByRole ( 'meter' ) ;
127+
128+ expect ( disk1 . className ) . toMatch ( / _ y e l l o w \b / i) ;
129+ expect ( disk2 . className ) . toMatch ( / _ r e d \b / i) ;
130+ } ) ;
131+
132+ it ( 'Should always display donor VDisks with a regular color' , ( ) => {
133+ const { getAllByRole} = render (
134+ < >
135+ < VDisk
136+ VDiskId = { { Domain : 1 } }
137+ VDiskState = "OK" // severity 1, green
138+ Replicated = { false } // donors are always in the not replicated state since they are leftovers
139+ DonorMode
140+ />
141+ < VDisk
142+ VDiskId = { { Domain : 2 } }
143+ VDiskState = "Initial" // severity 3, yellow
144+ Replicated = { false }
145+ DonorMode
146+ />
147+ < VDisk
148+ VDiskId = { { Domain : 3 } }
149+ VDiskState = "PDiskError" // severity 5, red
150+ Replicated = { false }
151+ DonorMode
105152 />
106153 </ >
107154 ) ;
108155
109156 const [ disk1 , disk2 , disk3 ] = getAllByRole ( 'meter' ) ;
110157
111- expect ( disk1 . className ) . toMatch ( / _ b l u e \b / i) ;
112- expect ( disk2 . className ) . not . toMatch ( / _ b l u e \b / i) ;
113- expect ( disk3 . className ) . not . toMatch ( / _ b l u e \b / i) ;
158+ expect ( disk1 . className ) . not . toMatch ( / _ b l u e \b / i) ;
159+ expect ( disk1 . className ) . toMatch ( / _ g r e e n \b / i) ;
160+ expect ( disk2 . className ) . toMatch ( / _ y e l l o w \b / i) ;
161+ expect ( disk3 . className ) . toMatch ( / _ r e d \b / i) ;
114162 } ) ;
115163} ) ;
0 commit comments