Skip to content

Commit

Permalink
Error summary unit tests and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Jun 29, 2020
1 parent df8cd22 commit 881d20f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/govukwc-error-summary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'govukwc-webcomponents/components/govukwc-error-summary/govukwc-error-sum

| Property | Type | Default | Description |
|-----------|-----------|---------|-------------|
| `title`|`string`|""|""|
| `title`|`string`|""|Error summary title|

### Slots

Expand All @@ -31,6 +31,6 @@ import 'govukwc-webcomponents/components/govukwc-error-summary/govukwc-error-sum

| Property | Type | Default | Description |
|-----------|-----------|---------|-------------|
| `target`|`string`|""|""
| `message`|`string`|""|""|
| `target`|`string`|""|The target id of invalid component
| `message`|`string`|""|Associated error message|

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { html, LitElement } from 'lit-element';
export class ErrorSummaryItemComponent extends LitElement {
static get properties() {
return {
/**
* The target id of invalid component
*/
target: { type: String },
/**
* Associated error message
*/
message: { type: String },
};
}
Expand Down
3 changes: 3 additions & 0 deletions components/govukwc-error-summary/govukwc-error-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import './govukwc-error-summary-item';
export class ErrorSummaryComponent extends LitElement {
static get properties() {
return {
/**
* Error summary title
*/
title: { type: String },
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { fixture, expect } from '@open-wc/testing';
import * as stories from './govukwc-error-summary.stories';

describe('govukwc-error-summary', () => {
it(`should render`, async () => {
const el = await fixture(stories.Default());
expect(el.shadowRoot.innerHTML).to.equalSnapshot();
});
});

0 comments on commit 881d20f

Please sign in to comment.