-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add typings generation tests for non-linked attribute property with r…
…eference sets
- Loading branch information
1 parent
73b09ed
commit 9681bd1
Showing
3 changed files
with
156 additions
and
0 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
95 changes: 95 additions & 0 deletions
95
...-widgets-tools/src/typings-generator/__tests__/inputs/non-linked-list-attribute-refset.ts
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,95 @@ | ||
export const nonLinkedListAttributeWebInput = `<?xml version="1.0" encoding="utf-8"?> | ||
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true" pluginWidget="true" | ||
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd"> | ||
<properties> | ||
<propertyGroup caption="General"> | ||
<property key="referenceDefault" type="attribute"> | ||
<caption>Reference</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
</property> | ||
<property key="reference" type="attribute"> | ||
<caption>Reference</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="Reference"/> | ||
</associationTypes> | ||
</property> | ||
<property key="referenceSet" type="attribute"> | ||
<caption>Reference Set</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="ReferenceSet"/> | ||
</associationTypes> | ||
</property> | ||
<property key="referenceOrSet" type="attribute"> | ||
<caption>Reference or Set</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="Reference"/> | ||
<associationType name="ReferenceSet"/> | ||
</associationTypes> | ||
</property> | ||
</propertyGroup> | ||
</properties> | ||
</widget>`; | ||
|
||
export const nonLinkedListAttributeNativeInput = `<?xml version="1.0" encoding="utf-8"?> | ||
<widget id="mendix.mywidget.MyWidget" needsEntityContext="true" offlineCapable="true" pluginWidget="true" supportedPlatform="Native" | ||
xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../xsd/widget.xsd"> | ||
<properties> | ||
<propertyGroup caption="General"> | ||
<property key="referenceDefault" type="attribute"> | ||
<caption>Reference</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
</property> | ||
<property key="reference" type="attribute"> | ||
<caption>Reference</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="Reference"/> | ||
</associationTypes> | ||
</property> | ||
<property key="referenceSet" type="attribute"> | ||
<caption>Reference Set</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="ReferenceSet"/> | ||
</associationTypes> | ||
</property> | ||
<property key="referenceOrSet" type="attribute"> | ||
<caption>Reference or Set</caption> | ||
<description/> | ||
<attributeTypes> | ||
<attributeType name="String" /> | ||
</attributeTypes> | ||
<associationTypes> | ||
<associationType name="Reference"/> | ||
<associationType name="ReferenceSet"/> | ||
</associationTypes> | ||
</property> | ||
</propertyGroup> | ||
</properties> | ||
</widget>`; |
43 changes: 43 additions & 0 deletions
43
...widgets-tools/src/typings-generator/__tests__/outputs/non-linked-list-attribute-refset.ts
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,43 @@ | ||
export const nonLinkedListAttributeWebOutput = `/** | ||
* This file was generated from MyWidget.xml | ||
* WARNING: All changes made to this file will be overwritten | ||
* @author Mendix Widgets Framework Team | ||
*/ | ||
import { CSSProperties } from "react"; | ||
import { EditableValue, EditableListValue } from "mendix"; | ||
export interface MyWidgetContainerProps { | ||
name: string; | ||
class: string; | ||
style?: CSSProperties; | ||
tabIndex?: number; | ||
referenceDefault: EditableValue<string>; | ||
reference: EditableValue<string>; | ||
referenceSet: EditableListValue<string>; | ||
referenceOrSet: EditableValue<string> | EditableListValue<string>; | ||
} | ||
export interface MyWidgetPreviewProps { | ||
/** | ||
* @deprecated Deprecated since version 9.18.0. Please use class property instead. | ||
*/ | ||
className: string; | ||
class: string; | ||
style: string; | ||
styleObject?: CSSProperties; | ||
readOnly: boolean; | ||
referenceDefault: string; | ||
reference: string; | ||
referenceSet: string; | ||
referenceOrSet: string; | ||
} | ||
`; | ||
|
||
export const nonLinkedListAttributeNativeOutput = `export interface MyWidgetProps<Style> { | ||
name: string; | ||
style: Style[]; | ||
referenceDefault: EditableValue<string>; | ||
reference: EditableValue<string>; | ||
referenceSet: EditableListValue<string>; | ||
referenceOrSet: EditableValue<string> | EditableListValue<string>; | ||
}`; |