-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: more tests for duplicates detection
- Loading branch information
1 parent
4a426fe
commit 3576c5e
Showing
37 changed files
with
786 additions
and
13 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
12 changes: 12 additions & 0 deletions
12
...__tests__/fixtures/scoped-slots/if-block/invalid/duplicate-default-slot-after/actual.html
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,12 @@ | ||
<template lwc:render-mode="light"> | ||
<template lwc:if={showStandard}> | ||
<slot></slot> | ||
</template> | ||
<template lwc:elseif={showVariant}> | ||
<slot lwc:slot-bind={slot1VariantData}></slot> | ||
</template> | ||
<template lwc:else> | ||
<slot lwc:slot-bind={slot2VariantData}></slot> | ||
</template> | ||
<slot lwc:slot-bind={slot3VariantData}></slot> | ||
</template> |
1 change: 1 addition & 0 deletions
1
...rc/__tests__/fixtures/scoped-slots/if-block/invalid/duplicate-default-slot-after/ast.json
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 @@ | ||
{} |
3 changes: 3 additions & 0 deletions
3
...__tests__/fixtures/scoped-slots/if-block/invalid/duplicate-default-slot-after/config.json
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,3 @@ | ||
{ | ||
"enableScopedSlots": true | ||
} |
Empty file.
15 changes: 15 additions & 0 deletions
15
...tests__/fixtures/scoped-slots/if-block/invalid/duplicate-default-slot-after/metadata.json
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,15 @@ | ||
{ | ||
"warnings": [ | ||
{ | ||
"code": 1172, | ||
"message": "LWC1172: Invalid duplicate scoped slots (default)", | ||
"level": 1, | ||
"location": { | ||
"line": 11, | ||
"column": 5, | ||
"start": 320, | ||
"length": 46 | ||
} | ||
} | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
..._tests__/fixtures/scoped-slots/if-block/invalid/duplicate-default-slot-before/actual.html
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,9 @@ | ||
<template lwc:render-mode="light"> | ||
<slot lwc:slot-bind={slot1VariantData}></slot> | ||
<template lwc:if={showStandard}> | ||
<slot></slot> | ||
</template> | ||
<template lwc:elseif={showVariant}> | ||
<slot lwc:slot-bind={slot1VariantData}></slot> | ||
</template> | ||
</template> |
1 change: 1 addition & 0 deletions
1
...c/__tests__/fixtures/scoped-slots/if-block/invalid/duplicate-default-slot-before/ast.json
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 @@ | ||
{} |
3 changes: 3 additions & 0 deletions
3
..._tests__/fixtures/scoped-slots/if-block/invalid/duplicate-default-slot-before/config.json
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,3 @@ | ||
{ | ||
"enableScopedSlots": true | ||
} |
Empty file.
26 changes: 26 additions & 0 deletions
26
...ests__/fixtures/scoped-slots/if-block/invalid/duplicate-default-slot-before/metadata.json
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,26 @@ | ||
{ | ||
"warnings": [ | ||
{ | ||
"code": 1173, | ||
"message": "LWC1173: Mixing slot types disallowed for same (default) slot.", | ||
"level": 1, | ||
"location": { | ||
"line": 4, | ||
"column": 9, | ||
"start": 131, | ||
"length": 13 | ||
} | ||
}, | ||
{ | ||
"code": 1172, | ||
"message": "LWC1172: Invalid duplicate scoped slots (default)", | ||
"level": 1, | ||
"location": { | ||
"line": 7, | ||
"column": 9, | ||
"start": 209, | ||
"length": 46 | ||
} | ||
} | ||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
...c/__tests__/fixtures/scoped-slots/if-block/invalid/duplicate-named-slot-after/actual.html
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,9 @@ | ||
<template lwc:render-mode="light"> | ||
<template lwc:if={showStandard}> | ||
<slot name="slotname1"></slot> | ||
</template> | ||
<template lwc:else> | ||
<slot name="slotname1" lwc:slot-bind={slot1VariantData}></slot> | ||
</template> | ||
<slot name="slotname1" lwc:slot-bind={slot1VariantData}></slot> | ||
</template> |
1 change: 1 addition & 0 deletions
1
.../src/__tests__/fixtures/scoped-slots/if-block/invalid/duplicate-named-slot-after/ast.json
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 @@ | ||
{} |
3 changes: 3 additions & 0 deletions
3
...c/__tests__/fixtures/scoped-slots/if-block/invalid/duplicate-named-slot-after/config.json
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,3 @@ | ||
{ | ||
"enableScopedSlots": true | ||
} |
Empty file.
15 changes: 15 additions & 0 deletions
15
...__tests__/fixtures/scoped-slots/if-block/invalid/duplicate-named-slot-after/metadata.json
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,15 @@ | ||
{ | ||
"warnings": [ | ||
{ | ||
"code": 1172, | ||
"message": "LWC1172: Invalid duplicate scoped slots (name=\"slotname1\")", | ||
"level": 1, | ||
"location": { | ||
"line": 8, | ||
"column": 5, | ||
"start": 243, | ||
"length": 63 | ||
} | ||
} | ||
] | ||
} |
8 changes: 8 additions & 0 deletions
8
...-compiler/src/__tests__/fixtures/scoped-slots/if-block/valid/mixed-slot-types/actual.html
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,8 @@ | ||
<template lwc:render-mode="light"> | ||
<template lwc:if={showStandard}> | ||
<slot name="slotname1"></slot> | ||
</template> | ||
<template lwc:elseif={showVariant}> | ||
<slot name="slotname1" lwc:slot-bind={slot1VariantData}></slot> | ||
</template> | ||
</template> |
250 changes: 250 additions & 0 deletions
250
...ate-compiler/src/__tests__/fixtures/scoped-slots/if-block/valid/mixed-slot-types/ast.json
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,250 @@ | ||
{ | ||
"root": { | ||
"type": "Root", | ||
"location": { | ||
"startLine": 1, | ||
"startColumn": 1, | ||
"endLine": 8, | ||
"endColumn": 12, | ||
"start": 0, | ||
"end": 266, | ||
"startTag": { | ||
"startLine": 1, | ||
"startColumn": 1, | ||
"endLine": 1, | ||
"endColumn": 35, | ||
"start": 0, | ||
"end": 34 | ||
}, | ||
"endTag": { | ||
"startLine": 8, | ||
"startColumn": 1, | ||
"endLine": 8, | ||
"endColumn": 12, | ||
"start": 255, | ||
"end": 266 | ||
} | ||
}, | ||
"directives": [ | ||
{ | ||
"type": "Directive", | ||
"name": "RenderMode", | ||
"value": { | ||
"type": "Literal", | ||
"value": "light" | ||
}, | ||
"location": { | ||
"startLine": 1, | ||
"startColumn": 11, | ||
"endLine": 1, | ||
"endColumn": 34, | ||
"start": 10, | ||
"end": 33 | ||
} | ||
} | ||
], | ||
"children": [ | ||
{ | ||
"type": "IfBlock", | ||
"condition": { | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 13, | ||
"name": "showStandard", | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 15, | ||
"endLine": 2, | ||
"endColumn": 36, | ||
"start": 49, | ||
"end": 70 | ||
} | ||
}, | ||
"location": { | ||
"startLine": 2, | ||
"startColumn": 5, | ||
"endLine": 4, | ||
"endColumn": 16, | ||
"start": 39, | ||
"end": 126 | ||
}, | ||
"directiveLocation": { | ||
"startLine": 2, | ||
"startColumn": 15, | ||
"endLine": 2, | ||
"endColumn": 36, | ||
"start": 49, | ||
"end": 70 | ||
}, | ||
"children": [ | ||
{ | ||
"type": "Slot", | ||
"name": "slot", | ||
"namespace": "http://www.w3.org/1999/xhtml", | ||
"slotName": "slotname1", | ||
"location": { | ||
"startLine": 3, | ||
"startColumn": 9, | ||
"endLine": 3, | ||
"endColumn": 39, | ||
"start": 80, | ||
"end": 110, | ||
"startTag": { | ||
"startLine": 3, | ||
"startColumn": 9, | ||
"endLine": 3, | ||
"endColumn": 32, | ||
"start": 80, | ||
"end": 103 | ||
}, | ||
"endTag": { | ||
"startLine": 3, | ||
"startColumn": 32, | ||
"endLine": 3, | ||
"endColumn": 39, | ||
"start": 103, | ||
"end": 110 | ||
} | ||
}, | ||
"attributes": [ | ||
{ | ||
"type": "Attribute", | ||
"name": "name", | ||
"value": { | ||
"type": "Literal", | ||
"value": "slotname1" | ||
}, | ||
"location": { | ||
"startLine": 3, | ||
"startColumn": 15, | ||
"endLine": 3, | ||
"endColumn": 31, | ||
"start": 86, | ||
"end": 102 | ||
} | ||
} | ||
], | ||
"properties": [], | ||
"directives": [], | ||
"listeners": [], | ||
"children": [] | ||
} | ||
], | ||
"else": { | ||
"type": "ElseifBlock", | ||
"condition": { | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 12, | ||
"name": "showVariant", | ||
"location": { | ||
"startLine": 5, | ||
"startColumn": 15, | ||
"endLine": 5, | ||
"endColumn": 39, | ||
"start": 141, | ||
"end": 165 | ||
} | ||
}, | ||
"location": { | ||
"startLine": 5, | ||
"startColumn": 5, | ||
"endLine": 7, | ||
"endColumn": 16, | ||
"start": 131, | ||
"end": 254 | ||
}, | ||
"directiveLocation": { | ||
"startLine": 5, | ||
"startColumn": 15, | ||
"endLine": 5, | ||
"endColumn": 39, | ||
"start": 141, | ||
"end": 165 | ||
}, | ||
"children": [ | ||
{ | ||
"type": "Slot", | ||
"name": "slot", | ||
"namespace": "http://www.w3.org/1999/xhtml", | ||
"slotName": "slotname1", | ||
"location": { | ||
"startLine": 6, | ||
"startColumn": 9, | ||
"endLine": 6, | ||
"endColumn": 72, | ||
"start": 175, | ||
"end": 238, | ||
"startTag": { | ||
"startLine": 6, | ||
"startColumn": 9, | ||
"endLine": 6, | ||
"endColumn": 65, | ||
"start": 175, | ||
"end": 231 | ||
}, | ||
"endTag": { | ||
"startLine": 6, | ||
"startColumn": 65, | ||
"endLine": 6, | ||
"endColumn": 72, | ||
"start": 231, | ||
"end": 238 | ||
} | ||
}, | ||
"attributes": [ | ||
{ | ||
"type": "Attribute", | ||
"name": "name", | ||
"value": { | ||
"type": "Literal", | ||
"value": "slotname1" | ||
}, | ||
"location": { | ||
"startLine": 6, | ||
"startColumn": 15, | ||
"endLine": 6, | ||
"endColumn": 31, | ||
"start": 181, | ||
"end": 197 | ||
} | ||
} | ||
], | ||
"properties": [], | ||
"directives": [ | ||
{ | ||
"type": "Directive", | ||
"name": "SlotBind", | ||
"value": { | ||
"type": "Identifier", | ||
"start": 1, | ||
"end": 17, | ||
"name": "slot1VariantData", | ||
"location": { | ||
"startLine": 6, | ||
"startColumn": 32, | ||
"endLine": 6, | ||
"endColumn": 64, | ||
"start": 198, | ||
"end": 230 | ||
} | ||
}, | ||
"location": { | ||
"startLine": 6, | ||
"startColumn": 32, | ||
"endLine": 6, | ||
"endColumn": 64, | ||
"start": 198, | ||
"end": 230 | ||
} | ||
} | ||
], | ||
"listeners": [], | ||
"children": [] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.