1- /* eslint-disable prettier/prettier */
21import { module , test } from 'qunit' ;
32import { setupRenderingTest } from 'ember-qunit' ;
43import { render } from '@ember/test-helpers' ;
54import hbs from 'htmlbars-inline-precompile' ;
65
7- module ( 'Integration | Component | paper-card' , function ( hooks ) {
6+ module ( 'Integration | Component | paper-card' , function ( hooks ) {
87 setupRenderingTest ( hooks ) ;
98
10- test ( 'blockless media renders image' , async function ( assert ) {
9+ test ( 'blockless media renders image' , async function ( assert ) {
1110 assert . expect ( 5 ) ;
1211
1312 await render ( hbs `
@@ -36,7 +35,7 @@ module('Integration | Component | paper-card', function(hooks) {
3635 assert . dom ( 'img' ) . hasClass ( 'md-media-xl' ) ;
3736 } ) ;
3837
39- test ( 'block media renders div with correct class' , async function ( assert ) {
38+ test ( 'block media renders div with correct class' , async function ( assert ) {
4039 assert . expect ( 1 ) ;
4140
4241 await render ( hbs `
@@ -62,4 +61,52 @@ module('Integration | Component | paper-card', function(hooks) {
6261
6362 assert . dom ( 'div.md-media-xl' ) . exists ( { count : 1 } ) ;
6463 } ) ;
64+
65+ test ( 'block actions renders tag with default layout classes' , async function ( assert ) {
66+ assert . expect ( 3 ) ;
67+
68+ await render ( hbs `
69+ {{#paper-card as |card|}}
70+ {{#card.actions}}
71+ {{#paper-button iconButton=true}}{{paper-icon "favorite"}}{{/paper-button}}
72+ {{/card.actions}}
73+ {{/paper-card}}
74+ ` ) ;
75+
76+ assert . dom ( 'md-card-actions' ) . exists ( { count : 1 } ) ;
77+ assert . dom ( 'md-card-actions' ) . hasClass ( 'layout-row' ) ;
78+ assert . dom ( 'md-card-actions' ) . hasClass ( 'layout-align-end-center' ) ;
79+ } ) ;
80+
81+ test ( 'block actions renders tag with passed through layout classes' , async function ( assert ) {
82+ assert . expect ( 2 ) ;
83+
84+ await render ( hbs `
85+ {{#paper-card as |card|}}
86+ {{#card.actions class="layout-column"}}
87+ {{#paper-button iconButton=true}}{{paper-icon "favorite"}}{{/paper-button}}
88+ {{/card.actions}}
89+ {{/paper-card}}
90+ ` ) ;
91+
92+ assert . dom ( 'md-card-actions' ) . exists ( { count : 1 } ) ;
93+ assert . dom ( 'md-card-actions' ) . hasClass ( 'layout-column' ) ;
94+ } ) ;
95+
96+ test ( 'block actions renders tag with passed through non-layout classes' , async function ( assert ) {
97+ assert . expect ( 4 ) ;
98+
99+ await render ( hbs `
100+ {{#paper-card as |card|}}
101+ {{#card.actions class="call-to-action"}}
102+ {{#paper-button iconButton=true}}{{paper-icon "favorite"}}{{/paper-button}}
103+ {{/card.actions}}
104+ {{/paper-card}}
105+ ` ) ;
106+
107+ assert . dom ( 'md-card-actions' ) . exists ( { count : 1 } ) ;
108+ assert . dom ( 'md-card-actions' ) . hasClass ( 'layout-row' ) ;
109+ assert . dom ( 'md-card-actions' ) . hasClass ( 'layout-align-end-center' ) ;
110+ assert . dom ( 'md-card-actions' ) . hasClass ( 'call-to-action' ) ;
111+ } ) ;
65112} ) ;
0 commit comments