@@ -328,6 +328,7 @@ module('Integration | operator-mode', function (hooks) {
328
328
329
329
class PublishingPacket extends CardDef {
330
330
static displayName = ' Publishing Packet' ;
331
+ static headerColor = ' #6638ff' ; // rgb(102, 56, 255);
331
332
@field blogPost = linksTo (BlogPost );
332
333
@field socialBlurb = contains (TextAreaField );
333
334
}
@@ -351,6 +352,11 @@ module('Integration | operator-mode', function (hooks) {
351
352
firstName: ' Alien' ,
352
353
lastName: ' Bob' ,
353
354
});
355
+ let blogPost = new BlogPost ({
356
+ title: ' Outer Space Journey' ,
357
+ body: ' Hello world' ,
358
+ authorBio: author1 ,
359
+ });
354
360
355
361
// Generate 11 person card to test recent card menu in card sheet
356
362
let personCards: Map <String , any > = new Map <String , any >();
@@ -497,13 +503,13 @@ module('Integration | operator-mode', function (hooks) {
497
503
firstName: ' Mark' ,
498
504
lastName: ' Jackson' ,
499
505
}),
500
- ' BlogPost/1.json' : new BlogPost ({
501
- title: ' Outer Space Journey' ,
502
- body: ' Hello world' ,
503
- authorBio: author1 ,
504
- }),
506
+ ' BlogPost/1.json' : blogPost ,
505
507
' BlogPost/2.json' : new BlogPost ({ title: ' Beginnings' }),
506
508
' CardDef/1.json' : new CardDef ({ title: ' CardDef instance' }),
509
+ ' PublishingPacket/story.json' : new PublishingPacket ({
510
+ title: ' Space Story' ,
511
+ blogPost ,
512
+ }),
507
513
' .realm.json' : ` { "name": "${realmName }", "iconURL": "https://boxel-images.boxel.ai/icons/Letter-o.png" } ` ,
508
514
... Object .fromEntries (personCards ),
509
515
},
@@ -2972,7 +2978,7 @@ module('Integration | operator-mode', function (hooks) {
2972
2978
assert
2973
2979
.dom (` [data-test-cards-grid-item="${testRealmURL }CardDef/1"] ` )
2974
2980
.exists ();
2975
- assert .dom (` [data-test-boxel-filter-list-button] ` ).exists ({ count: 9 });
2981
+ assert .dom (` [data-test-boxel-filter-list-button] ` ).exists ({ count: 10 });
2976
2982
assert .dom (` [data-test-boxel-filter-list-button="Skill"] ` ).doesNotExist ();
2977
2983
2978
2984
await click (' [data-test-create-new-card-button]' );
@@ -2992,7 +2998,7 @@ module('Integration | operator-mode', function (hooks) {
2992
2998
await click (' [data-test-close-button]' );
2993
2999
},
2994
3000
});
2995
- assert .dom (` [data-test-boxel-filter-list-button] ` ).exists ({ count: 10 });
3001
+ assert .dom (` [data-test-boxel-filter-list-button] ` ).exists ({ count: 11 });
2996
3002
assert .dom (` [data-test-boxel-filter-list-button="Skill"] ` ).exists ();
2997
3003
2998
3004
await click (' [data-test-boxel-filter-list-button="Skill"]' );
@@ -3008,7 +3014,7 @@ module('Integration | operator-mode', function (hooks) {
3008
3014
},
3009
3015
});
3010
3016
3011
- assert .dom (` [data-test-boxel-filter-list-button] ` ).exists ({ count: 9 });
3017
+ assert .dom (` [data-test-boxel-filter-list-button] ` ).exists ({ count: 10 });
3012
3018
assert .dom (` [data-test-boxel-filter-list-button="Skill"] ` ).doesNotExist ();
3013
3019
assert
3014
3020
.dom (` [data-test-boxel-filter-list-button="All Cards"] ` )
@@ -3066,4 +3072,49 @@ module('Integration | operator-mode', function (hooks) {
3066
3072
.dom (` [data-test-stack-card-index="0"] ` )
3067
3073
.doesNotHaveClass (' opening-animation' );
3068
3074
});
3075
+
3076
+ test (' stack item with custom header color does not lose the color when opening other cards in the stack' , async function (assert ) {
3077
+ const cardId = ` ${testRealmURL }PublishingPacket/story ` ;
3078
+ const customStyle = {
3079
+ backgroundColor: ' rgb(102, 56, 255)' ,
3080
+ color: ' rgb(255, 255, 255)' ,
3081
+ };
3082
+ await setCardInOperatorModeState (cardId );
3083
+ await renderComponent (
3084
+ class TestDriver extends GlimmerComponent {
3085
+ <template >
3086
+ <OperatorMode @ onClose ={{noop }} />
3087
+ <CardPrerender />
3088
+ </template >
3089
+ },
3090
+ );
3091
+ assert .dom (` [data-test-stack-card="${cardId }"] ` ).exists ();
3092
+ assert
3093
+ .dom (` [data-stack-card="${cardId }"] [data-test-card-header] ` )
3094
+ .hasStyle (customStyle );
3095
+
3096
+ await click (` [data-test-card="${testRealmURL }BlogPost/1"] ` );
3097
+ assert .dom (` [data-test-stack-card="${testRealmURL }BlogPost/1"] ` ).exists ();
3098
+ assert
3099
+ .dom (
3100
+ ` [data-stack-card="${testRealmURL }BlogPost/1"] [data-test-card-header] ` ,
3101
+ )
3102
+ .hasStyle ({
3103
+ backgroundColor: ' rgb(255, 255, 255)' ,
3104
+ color: ' rgb(0, 0, 0)' ,
3105
+ });
3106
+ assert
3107
+ .dom (` [data-stack-card="${cardId }"] [data-test-card-header] ` )
3108
+ .hasStyle (customStyle );
3109
+
3110
+ await click (
3111
+ ` [data-stack-card="${testRealmURL }BlogPost/1"] [data-test-close-button] ` ,
3112
+ );
3113
+ await waitFor (` [data-test-stack-card="${testRealmURL }BlogPost/1"] ` , {
3114
+ count: 0 ,
3115
+ });
3116
+ assert
3117
+ .dom (` [data-stack-card="${cardId }"] [data-test-card-header] ` )
3118
+ .hasStyle (customStyle );
3119
+ });
3069
3120
});
0 commit comments