@@ -27,6 +27,49 @@ describe( 'Button Block Filters', () => {
2727 // Style option should be applied
2828 cy . getSelectByLabel ( 'Style' ) . select ( 'brand' ) ;
2929
30+ // Style should be visible in UI
31+ cy . get ( '.wp-block-wp-bootstrap-blocks-button' ) . should (
32+ 'have.attr' ,
33+ 'style' ,
34+ 'background-color: rgb(255, 0, 0); color: rgb(255, 255, 255);'
35+ ) ;
36+
37+ // Editor content should match snapshot
38+ cy . postContentMatchesSnapshot ( ) ;
39+ } ) ;
40+
41+ it ( 'Deprecated color attribute should be visible in UI' , ( ) => {
42+ cy . insertButtonBlock ( ) ;
43+ cy . selectButtonBlock ( ) ;
44+ cy . ensureSidebarOpened ( ) ;
45+
46+ cy . getSelectByLabel ( 'Style' ) . select ( 'brand-deprecated-color' ) ;
47+
48+ // Style should be visible in UI
49+ cy . get ( '.wp-block-wp-bootstrap-blocks-button' ) . should (
50+ 'have.attr' ,
51+ 'style' ,
52+ 'background-color: rgb(255, 0, 0); color: rgb(255, 255, 255);'
53+ ) ;
54+
55+ // Editor content should match snapshot
56+ cy . postContentMatchesSnapshot ( ) ;
57+ } ) ;
58+
59+ it ( 'Use default colors if textColor or bgColor attributes are missing in styleOption' , ( ) => {
60+ cy . insertButtonBlock ( ) ;
61+ cy . selectButtonBlock ( ) ;
62+ cy . ensureSidebarOpened ( ) ;
63+
64+ cy . getSelectByLabel ( 'Style' ) . select ( 'missing-colors' ) ;
65+
66+ // Style should be visible in UI
67+ cy . get ( '.wp-block-wp-bootstrap-blocks-button' ) . should (
68+ 'have.attr' ,
69+ 'style' ,
70+ 'background-color: rgb(0, 123, 255); color: rgb(255, 255, 255);'
71+ ) ;
72+
3073 // Editor content should match snapshot
3174 cy . postContentMatchesSnapshot ( ) ;
3275 } ) ;
0 commit comments