Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12588 from phated/guard-duplicate-in-createSummar…
…yValue Addon-docs: Move summary & detail equality check to createSummaryValue
- Loading branch information
Showing
5 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { createSummaryValue } from './utils'; | ||
|
||
describe('createSummaryValue', () => { | ||
it('creates an object with just summary if detail is not passed', () => { | ||
const summary = 'boolean'; | ||
expect(createSummaryValue(summary)).toEqual({ summary }); | ||
}); | ||
|
||
it('creates an object with summary & detail if passed', () => { | ||
const summary = 'MyType'; | ||
const detail = 'boolean | string'; | ||
expect(createSummaryValue(summary, detail)).toEqual({ summary, detail }); | ||
}); | ||
|
||
it('creates an object with just summary if details are equal', () => { | ||
const summary = 'boolean'; | ||
const detail = 'boolean'; | ||
expect(createSummaryValue(summary, detail)).toEqual({ summary }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters