@@ -16,21 +16,23 @@ const { AttributeKind } = ParameterAttributes.constants;
1616
1717const { ParameterMetaAttribute } = ParameterAttributes . components ;
1818
19- const defaultMetadata = { kind : AttributeKind . default , value : 3 } ;
20- const minimumMetadata = { kind : AttributeKind . minimum , value : 20 } ;
21- const maximumMetadata = { kind : AttributeKind . maximum , value : 50 } ;
22- const minimumExclusiveMetadata = { kind : AttributeKind . minimumExclusive , value : 2 } ;
23- const maximumExclusiveMetadata = { kind : AttributeKind . maximumExclusive , value : 5 } ;
19+ const defaultMetadata = { kind : AttributeKind . default , value : 3 , title : 'Default' } ;
20+ const minimumMetadata = { kind : AttributeKind . minimum , value : 20 , title : 'Minimum Value' } ;
21+ const maximumMetadata = { kind : AttributeKind . maximum , value : 50 , title : 'Maximum Length' } ;
22+ const minimumExclusiveMetadata = { kind : AttributeKind . minimumExclusive , value : 2 , title : 'Minimum' } ;
23+ const maximumExclusiveMetadata = { kind : AttributeKind . maximumExclusive , value : 5 , title : 'Maximum' } ;
2424const allowedValuesMetadata = {
2525 kind : AttributeKind . allowedValues ,
2626 values : [ "'one'" , "'two'" ] ,
27+ title : 'Allowed Values' ,
2728} ;
2829const allowedTypesMetadata = {
2930 kind : AttributeKind . allowedTypes ,
3031 values : [
3132 [ { kind : 'text' , text : 'string' } ] ,
3233 [ { kind : 'text' , text : 'number' } ] ,
3334 ] ,
35+ title : 'Allowed Types' ,
3436} ;
3537
3638const mountComponent = propsData => mount ( ParameterAttributes , {
@@ -60,12 +62,12 @@ describe('ParameterAttributes', () => {
6062 metadata
6163 . at ( 0 )
6264 . text ( ) ,
63- ) . toBe ( 'Minimum: 20' ) ;
65+ ) . toBe ( 'Minimum Value : 20' ) ;
6466 expect (
6567 metadata
6668 . at ( 1 )
6769 . text ( ) ,
68- ) . toBe ( 'Maximum: 50' ) ;
70+ ) . toBe ( 'Maximum Length : 50' ) ;
6971 } ) ;
7072
7173 it ( 'displays exclusive min/max metadata' , ( ) => {
@@ -150,8 +152,8 @@ describe('ParameterAttributes', () => {
150152 it ( 'passes changes to default metadata' , ( ) => {
151153 const changes = {
152154 [ AttributeKind . default ] : {
153- new : { value : 4 } ,
154- previous : { value : 2 } ,
155+ new : { value : 4 , title : 'Default' } ,
156+ previous : { value : 2 , title : 'Default' } ,
155157 } ,
156158 } ;
157159 const wrapper = mountComponent ( {
@@ -170,12 +172,12 @@ describe('ParameterAttributes', () => {
170172 it ( 'passes changes to minimum/maximum metadata' , ( ) => {
171173 const changes = {
172174 [ AttributeKind . minimum ] : {
173- new : { value : 4 } ,
174- previous : { value : 2 } ,
175+ new : { value : 4 , title : 'Minimum' } ,
176+ previous : { value : 2 , title : 'Minimum' } ,
175177 } ,
176178 [ AttributeKind . maximum ] : {
177- new : { value : 10 } ,
178- previous : { value : 7 } ,
179+ new : { value : 10 , title : 'Maximum' } ,
180+ previous : { value : 7 , title : 'Maximum' } ,
179181 } ,
180182 } ;
181183
@@ -208,12 +210,12 @@ describe('ParameterAttributes', () => {
208210 it ( 'passes changes to exclusive minimum/maximum metadata' , ( ) => {
209211 const changes = {
210212 [ AttributeKind . minimumExclusive ] : {
211- new : { value : 4 } ,
212- previous : { value : 2 } ,
213+ new : { value : 4 , title : 'Minimum' } ,
214+ previous : { value : 2 , title : 'Minimum' } ,
213215 } ,
214216 [ AttributeKind . maximumExclusive ] : {
215- new : { value : 10 } ,
216- previous : { value : 7 } ,
217+ new : { value : 10 , title : 'Maximum' } ,
218+ previous : { value : 7 , title : 'Maximum' } ,
217219 } ,
218220 } ;
219221
0 commit comments