Skip to content

Commit

Permalink
chore: refresh test-generator inputs from current golden file tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alharris-at committed Oct 14, 2021
1 parent 0b6f970 commit 04ab26d
Show file tree
Hide file tree
Showing 13 changed files with 573 additions and 288 deletions.
9 changes: 8 additions & 1 deletion packages/test-generator/lib/components/boxTest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"componentType": "Box",
"id": "I:5",
"properties": { "fontFamily": { "value": "Times New Roman" }, "fontSize": { "value": "20px" } },
"properties": {
"fontFamily": {
"value": "Times New Roman"
},
"fontSize": {
"value": "20px"
}
},
"overrides": {},
"name": "Test"
}
40 changes: 14 additions & 26 deletions packages/test-generator/lib/components/collectionWithBinding.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,20 @@
},
"collectionProperties": {
"buttonUser": {
"type": "Data",
"bindingProperties": {
"model": "User",
"predicate": {
"and": [
{
"field": "age",
"operand": "10",
"operator": "gt"
},
{
"field": "lastName",
"operand": "L",
"operator": "beginsWith"
}
]
}
}
},
"isDisabled": {
"bindingProperties": {
"predicate": {
"field": "index",
"operand": "5",
"operator": "eq"
}
"model": "User",
"predicate": {
"and": [
{
"field": "age",
"operand": "10",
"operator": "gt"
},
{
"field": "lastName",
"operand": "L",
"operator": "beginsWith"
}
]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"id": "1234-5678-9010",
"componentType": "Collection",
"name": "CollectionOfCustomButtons",
"properties": {
"type": {
"value": "list"
},
"isPaginated": {
"value": true
},
"gap": {
"value": "1.5rem"
},
"backgroundColor": {
"bindingProperties": {
"property": "backgroundColor"
}
}
},
"bindingProperties": {
"width": {
"type": "Number"
},
"backgroundColor": {
"type": "String"
},
"buttonColor": {
"type": "Data",
"bindingProperties": {
"model": "UserPreferences",
"predicate": {
"field": "userID",
"operand": "user@email.com",
"operator": "eq"
}
}
}
},
"collectionProperties": {
"buttonUser": {
"model": "User",
"sort": [
{
"field": "firstName",
"direction": "ASC"
},
{
"field": "lastName",
"direction": "DESC"
}
],
"predicate": {
"and": [
{
"field": "age",
"operand": "10",
"operator": "gt"
},
{
"field": "lastName",
"operand": "L",
"operator": "beginsWith"
}
]
}
}
},
"children": [
{
"componentType": "Flex",
"properties": {},
"children": [
{
"componentType": "Button",
"properties": {
"label": {
"collectionBindingProperties": {
"property": "buttonUser",
"field": "username"
},
"defaultValue": "hspain@gmail.com"
},
"labelWidth": {
"bindingProperties": {
"property": "width"
}
},
"backgroundColor": {
"bindingProperties": {
"property": "buttonColor",
"field": "favoriteColor"
}
},
"disabled": {
"bindingProperties": {
"property": "isDisabled"
}
}
}
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "ListingCardCollection",
"children": [
{
"children": [],
"name": "ListingCard",
"componentType": "ListingCard",
"properties": {
"marginRight": {
"value": "0"
},
"marginBottom": {
"value": "0"
},
"marginTop": {
"value": "0"
},
"marginLeft": {
"value": "0"
}
},
"overrides": {},
"variants": []
}
],
"id": "c-7m9oAaC8SO0M40Pnvu",
"bindingProperties": {},
"componentType": "Collection",
"properties": {
"isPaginated": {
"value": "true"
},
"collectionType": {
"value": "grid"
},
"type": {
"value": "list"
},
"columns": {
"value": "2"
},
"order": {
"value": "left-to-right"
}
},
"overrides": {},
"variants": [],
"collectionProperties": {
"bananas": {
"model": "UntitledModel"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "ListingCardCollection",
"children": [
{
"children": [],
"name": "ListingCard",
"componentType": "ListingCard",
"properties": {},
"overrides": {},
"variants": []
}
],
"id": "c-7m9oAaC8SO0M40Pnvu",
"bindingProperties": {},
"componentType": "Collection",
"properties": {
"type": {
"value": "list"
},
"isPaginated": {
"value": "true"
}
},
"overrides": {},
"variants": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"componentType": "Flex",
"name": "SiteHeader",
"actions": {
"openAmplifyDocs": {
"type": "Navigation.Open",
"parameters": {
"href": "docs.amplify.aws"
}
},
"redirectToFooter": {
"type": "Navigation.Redirect",
"parameters": {
"href": "#footer-id",
"replaceHistory": true
}
},
"navigateToFAQPage": {
"type": "Navigation.Redirect",
"parameters": {
"href": "/faq"
}
},
"reloadPage": {
"type": "Navigation.Refresh"
}
},
"properties": {
"direction": {
"value": "row"
},
"justifyContent": {
"value": "space-between"
}
},
"children": [
{
"componentType": "Heading",
"name": "Heading1",
"properties": {
"level": {
"value": 1
},
"children": {
"value": "Title"
}
}
},
{
"componentType": "Button",
"name": "Button1",
"events": {
"click": "openAmplifyDocs"
},
"properties": {
"variation": {
"value": "primary"
},
"children": {
"value": "Open Amplify Docs"
}
}
},
{
"componentType": "Button",
"name": "Button2",
"events": {
"click": "navigateToFAQPage"
},
"properties": {
"variation": {
"value": "primary"
},
"children": {
"value": "Navigate to FAQ Page"
}
}
},
{
"componentType": "Button",
"name": "Button3",
"events": {
"click": "reloadPage"
},
"properties": {
"variation": {
"value": "primary"
},
"children": {
"value": "Reload Page"
}
}
},
{
"componentType": "Button",
"name": "Button4",
"events": {
"click": "redirectToFooter"
},
"properties": {
"variation": {
"value": "primary"
},
"children": {
"value": "Redirect To Footer (No History Update)"
}
}
}
]
}
Loading

0 comments on commit 04ab26d

Please sign in to comment.