@@ -36,6 +36,36 @@ describe('Resistor Color Trio', () => {
3636 ) ;
3737 } ) ;
3838
39+ xtest ( 'Blue and violet and blue' , ( ) => {
40+ expect ( new ResistorColorTrio ( [ 'blue' , 'violet' , 'blue' ] ) . label ) . toEqual (
41+ makeLabel ( { value : 67 , unit : 'megaohms' } ) ,
42+ ) ;
43+ } ) ;
44+
45+ xtest ( 'Minimum possible value' , ( ) => {
46+ expect ( new ResistorColorTrio ( [ 'black' , 'black' , 'black' ] ) . label ) . toEqual (
47+ makeLabel ( { value : 0 , unit : 'ohms' } ) ,
48+ ) ;
49+ } ) ;
50+
51+ xtest ( 'Maximum possible value' , ( ) => {
52+ expect ( new ResistorColorTrio ( [ 'white' , 'white' , 'white' ] ) . label ) . toEqual (
53+ makeLabel ( { value : 99 , unit : 'gigaohms' } ) ,
54+ ) ;
55+ } ) ;
56+
57+ xtest ( 'First two colors make an invalid octal number' , ( ) => {
58+ expect ( new ResistorColorTrio ( [ 'black' , 'grey' , 'black' ] ) . label ) . toEqual (
59+ makeLabel ( { value : 8 , unit : 'ohms' } ) ,
60+ ) ;
61+ } ) ;
62+
63+ xtest ( 'Ignore extra colors' , ( ) => {
64+ expect ( new ResistorColorTrio ( [ 'blue' , 'green' , 'yellow' , 'orange' ] ) . label ) . toEqual (
65+ makeLabel ( { value : 650 , unit : 'kiloohms' } ) ,
66+ ) ;
67+ } ) ;
68+
3969 // optional: error
4070 xtest ( 'Invalid color' , ( ) => {
4171 expect (
0 commit comments