@@ -272,12 +247,16 @@ export class Card extends LikeAnchor(
protected override render(): TemplateResult {
return html`
- ${this.renderImage()}
+ ${when(
+ this.hasImage(),
+ () => this.renderImage(),
+ () => nothing
+ )}
+ `;
+};
+
+export const quietContained = (args: StoryArgs): TemplateResult => {
+ return html`
+
+
+
10/15/18
@@ -241,7 +263,7 @@ export const quietFile = (args: StoryArgs): TemplateResult => {
?horizontal=${args.horizontal}
style="width: 208px; height: 264px"
>
-

+
File Name
10/15/18
@@ -259,7 +281,7 @@ export const quietFolder = (args: StoryArgs): TemplateResult => {
?horizontal=${args.horizontal}
style="width: 208px; height: 264px"
>
-

+
Folder Name
10/15/18
@@ -277,7 +299,7 @@ export const quietActions = (args: StoryArgs): TemplateResult => {
?horizontal=${args.horizontal}
style="width: 208px; height: 264px"
>
-

+
10/15/18
{
subheading="JPG"
>
@@ -328,7 +350,7 @@ export const horizontalWithHREF = (args: StoryArgs): TemplateResult => {
target="_blank"
>
@@ -342,14 +364,14 @@ export const smallQuiet = (args: StoryArgs): TemplateResult => {
return html`
-
+
Footer
{
"
?horizontal=${args.horizontal}
>
-
+
diff --git a/packages/card/test/card.test.ts b/packages/card/test/card.test.ts
index 83af9f45dda..51eea61896c 100644
--- a/packages/card/test/card.test.ts
+++ b/packages/card/test/card.test.ts
@@ -10,78 +10,69 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
-import '@spectrum-web-components/card/sp-card.js';
-import { Card } from '@spectrum-web-components/card';
+import { elementUpdated, expect, fixture, html } from '@open-wc/testing';
import '@spectrum-web-components/action-menu/sp-action-menu.js';
-import '@spectrum-web-components/menu/sp-menu.js';
-import '@spectrum-web-components/menu/sp-menu-item.js';
+import { Card } from '@spectrum-web-components/card';
+import '@spectrum-web-components/card/sp-card.js';
+import { Checkbox } from '@spectrum-web-components/checkbox/src/Checkbox.js';
import '@spectrum-web-components/menu/sp-menu-divider.js';
-import { elementUpdated, expect, fixture, html } from '@open-wc/testing';
-
+import '@spectrum-web-components/menu/sp-menu-item.js';
+import '@spectrum-web-components/menu/sp-menu.js';
+import { spy } from 'sinon';
+import { sendMouse } from '../../../test/plugins/browser.js';
+import {
+ spaceEvent,
+ testForLitDevWarnings,
+} from '../../../test/testing-helpers.js';
import {
Default,
Horizontal,
href,
StoryArgs,
} from '../stories/card.stories.js';
-import { Checkbox } from '@spectrum-web-components/checkbox/src/Checkbox';
-import { spy } from 'sinon';
-import { spaceEvent } from '../../../test/testing-helpers.js';
-import { sendMouse } from '../../../test/plugins/browser.js';
-import { testForLitDevWarnings } from '../../../test/testing-helpers.js';
describe('card', () => {
testForLitDevWarnings(
async () =>
- await fixture(
- html`
-
-
- Footer
-
- `
- )
- );
- it('loads', async () => {
- const el = await fixture(
- html`
+ await fixture(html`
Footer
- `
- );
+ `)
+ );
+ it('loads', async () => {
+ const el = await fixture(html`
+
+
+ Footer
+
+ `);
await elementUpdated(el);
await expect(el).to.be.accessible();
});
it('loads - [quiet]', async () => {
- const el = await fixture(
- html`
-
-
- 10/15/18
- Footer
-
- `
- );
+ const el = await fixture(html`
+
+
+ 10/15/18
+ Footer
+
+ `);
await elementUpdated(el);
@@ -89,63 +80,55 @@ describe('card', () => {
});
it('loads - [quiet][small]', async () => {
- const el = await fixture(
- html`
- (html`
+
+
+ Footer
+
-
- Footer
-
-
- Deselect
- Select Inverse
- Feather...
- Select and Mask...
-
- Save Selection
- Make Work Path
-
-
-
- `
- );
+
+ Deselect
+ Select Inverse
+ Feather...
+ Select and Mask...
+
+ Save Selection
+ Make Work Path
+
+
+
+ `);
await elementUpdated(el);
await expect(el).to.be.accessible();
});
it('loads - [gallery]', async () => {
- const el = await fixture
(
- html`
-
-
- 10/15/18
- Footer
-
- `
- );
+ const el = await fixture(html`
+
+
+ 10/15/18
+ Footer
+
+ `);
await elementUpdated(el);
@@ -367,18 +350,16 @@ describe('card', () => {
});
it('displays the `heading` attribute as `.title`', async () => {
const testHeading = 'This is a test heading';
- const el = await fixture(
- html`
-
-
- Footer
-
- `
- );
+ const el = await fixture(html`
+
+
+ Footer
+
+ `);
await elementUpdated(el);
@@ -393,19 +374,17 @@ describe('card', () => {
});
it('displays the slotted content as `.title`', async () => {
const testHeading = 'This is a test heading';
- const el = await fixture(
- html`
-
- ${testHeading}
-
- Footer
-
- `
- );
+ const el = await fixture(html`
+
+ ${testHeading}
+
+ Footer
+
+ `);
await elementUpdated(el);
diff --git a/tools/grid/stories/grid.stories.ts b/tools/grid/stories/grid.stories.ts
index 5f972d8f480..fc0eccf5a34 100644
--- a/tools/grid/stories/grid.stories.ts
+++ b/tools/grid/stories/grid.stories.ts
@@ -68,7 +68,7 @@ const renderItem = (
>