Skip to content

Commit

Permalink
test: update tests after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ravijayaramappa committed Oct 5, 2022
1 parent 6dd9342 commit e8f640b
Show file tree
Hide file tree
Showing 18 changed files with 345 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ export const ParserDiagnostics = {

SLOT_TAG_CANNOT_HAVE_DIRECTIVES: {
code: 1082,
message: "Slot tag can't be associated with for:each, for:of or if:true/false directives",
message:
"Slot tag can't be associated with for:each, for:of, if:true, if:flase, lwc:if, lwc:else, lwc:elseif template directives.",
level: DiagnosticLevel.Error,
url: '',
},
Expand Down Expand Up @@ -723,14 +724,14 @@ export const ParserDiagnostics = {
level: DiagnosticLevel.Error,
url: '',
},

INVALID_ELSEIF_BLOCK_DIRECTIVE_WITH_CONDITIONAL: {
code: 1163,
message: "Invalid usage of 'lwc:elseif' and '{0}' directives on the same element.",
level: DiagnosticLevel.Error,
url: '',
},

INVALID_ELSE_BLOCK_DIRECTIVE_WITH_CONDITIONAL: {
code: 1164,
message: "Invalid usage of 'lwc:else' and '{0}' directives on the same element.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"warnings": [
{
"code": 1082,
"message": "LWC1082: Slot tag can't be associated with directives",
"message": "LWC1082: Slot tag can't be associated with for:each, for:of or if:true/false directives",
"level": 1,
"location": {
"line": 2,
Expand All @@ -13,7 +13,7 @@
},
{
"code": 1082,
"message": "LWC1082: Slot tag can't be associated with directives",
"message": "LWC1082: Slot tag can't be associated with for:each, for:of or if:true/false directives",
"level": 1,
"location": {
"line": 3,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,269 @@
{}
{
"root": {
"type": "Root",
"location": {
"startLine": 1,
"startColumn": 1,
"endLine": 5,
"endColumn": 12,
"start": 0,
"end": 214,
"startTag": {
"startLine": 1,
"startColumn": 1,
"endLine": 1,
"endColumn": 35,
"start": 0,
"end": 34
},
"endTag": {
"startLine": 5,
"startColumn": 1,
"endLine": 5,
"endColumn": 12,
"start": 203,
"end": 214
}
},
"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": "Slot",
"name": "slot",
"namespace": "http://www.w3.org/1999/xhtml",
"slotName": "slotname1",
"location": {
"startLine": 2,
"startColumn": 5,
"endLine": 2,
"endColumn": 61,
"start": 39,
"end": 95,
"startTag": {
"startLine": 2,
"startColumn": 5,
"endLine": 2,
"endColumn": 54,
"start": 39,
"end": 88
},
"endTag": {
"startLine": 2,
"startColumn": 54,
"endLine": 2,
"endColumn": 61,
"start": 88,
"end": 95
}
},
"attributes": [
{
"type": "Attribute",
"name": "name",
"value": {
"type": "Literal",
"value": "slotname1"
},
"location": {
"startLine": 2,
"startColumn": 11,
"endLine": 2,
"endColumn": 27,
"start": 45,
"end": 61
}
}
],
"properties": [],
"directives": [
{
"type": "Directive",
"name": "SlotBind",
"value": {
"type": "Identifier",
"start": 1,
"end": 10,
"name": "slot1data",
"location": {
"startLine": 2,
"startColumn": 28,
"endLine": 2,
"endColumn": 53,
"start": 62,
"end": 87
}
},
"location": {
"startLine": 2,
"startColumn": 28,
"endLine": 2,
"endColumn": 53,
"start": 62,
"end": 87
}
}
],
"listeners": [],
"children": []
},
{
"type": "Slot",
"name": "slot",
"namespace": "http://www.w3.org/1999/xhtml",
"slotName": "slotname2",
"location": {
"startLine": 3,
"startColumn": 5,
"endLine": 3,
"endColumn": 61,
"start": 100,
"end": 156,
"startTag": {
"startLine": 3,
"startColumn": 5,
"endLine": 3,
"endColumn": 54,
"start": 100,
"end": 149
},
"endTag": {
"startLine": 3,
"startColumn": 54,
"endLine": 3,
"endColumn": 61,
"start": 149,
"end": 156
}
},
"attributes": [
{
"type": "Attribute",
"name": "name",
"value": {
"type": "Literal",
"value": "slotname2"
},
"location": {
"startLine": 3,
"startColumn": 11,
"endLine": 3,
"endColumn": 27,
"start": 106,
"end": 122
}
}
],
"properties": [],
"directives": [
{
"type": "Directive",
"name": "SlotBind",
"value": {
"type": "Identifier",
"start": 1,
"end": 10,
"name": "slot2data",
"location": {
"startLine": 3,
"startColumn": 28,
"endLine": 3,
"endColumn": 53,
"start": 123,
"end": 148
}
},
"location": {
"startLine": 3,
"startColumn": 28,
"endLine": 3,
"endColumn": 53,
"start": 123,
"end": 148
}
}
],
"listeners": [],
"children": []
},
{
"type": "Slot",
"name": "slot",
"namespace": "http://www.w3.org/1999/xhtml",
"slotName": "",
"location": {
"startLine": 4,
"startColumn": 5,
"endLine": 4,
"endColumn": 46,
"start": 161,
"end": 202,
"startTag": {
"startLine": 4,
"startColumn": 5,
"endLine": 4,
"endColumn": 39,
"start": 161,
"end": 195
},
"endTag": {
"startLine": 4,
"startColumn": 39,
"endLine": 4,
"endColumn": 46,
"start": 195,
"end": 202
}
},
"attributes": [],
"properties": [],
"directives": [
{
"type": "Directive",
"name": "SlotBind",
"value": {
"type": "Identifier",
"start": 1,
"end": 12,
"name": "defaultdata",
"location": {
"startLine": 4,
"startColumn": 11,
"endLine": 4,
"endColumn": 38,
"start": 167,
"end": 194
}
},
"location": {
"startLine": 4,
"startColumn": 11,
"endLine": 4,
"endColumn": 38,
"start": 167,
"end": 194
}
}
],
"listeners": [],
"children": []
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"enableScopedSlots": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { registerTemplate } from "lwc";
const stc0 = {
attrs: {
name: "slotname1",
},
key: 0,
};
const stc1 = [];
const stc2 = {
attrs: {
name: "slotname2",
},
key: 1,
};
const stc3 = {
key: 2,
};
function tmpl($api, $cmp, $slotset, $ctx) {
const { s: api_slot, f: api_flatten } = $api;
return api_flatten([
api_slot("slotname1", stc0, stc1, $slotset),
api_slot("slotname2", stc2, stc1, $slotset),
api_slot("", stc3, stc1, $slotset),
]);
/*LWC compiler vX.X.X*/
}
export default registerTemplate(tmpl);
tmpl.slots = ["", "slotname1", "slotname2"];
tmpl.stylesheets = [];
tmpl.renderMode = "light";
Original file line number Diff line number Diff line change
@@ -1,37 +1,3 @@
{
"warnings": [
{
"code": 1159,
"message": "LWC1159: Invalid `lwc:slot-bind` usage. The \"Scoped Slots\" feature must be enabled in order to use this directive.",
"level": 1,
"location": {
"line": 2,
"column": 5,
"start": 39,
"length": 56
}
},
{
"code": 1159,
"message": "LWC1159: Invalid `lwc:slot-bind` usage. The \"Scoped Slots\" feature must be enabled in order to use this directive.",
"level": 1,
"location": {
"line": 3,
"column": 5,
"start": 100,
"length": 56
}
},
{
"code": 1159,
"message": "LWC1159: Invalid `lwc:slot-bind` usage. The \"Scoped Slots\" feature must be enabled in order to use this directive.",
"level": 1,
"location": {
"line": 4,
"column": 5,
"start": 161,
"length": 41
}
}
]
"warnings": []
}
Loading

0 comments on commit e8f640b

Please sign in to comment.