-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(babel-plugin-component): add more tests for
@wire
(#4939)
- Loading branch information
1 parent
8fb39b9
commit 7c31a3a
Showing
12 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...lugin-component/src/__tests__/fixtures/wire-decorator/decorator-on-getter-alone/actual.js
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 @@ | ||
import { wire, LightningElement } from "lwc"; | ||
import { Foo } from "data-service"; | ||
export default class Test extends LightningElement { | ||
@wire(Foo) | ||
get wiredProp () { | ||
return this._wiredProp | ||
} | ||
} |
Empty file.
25 changes: 25 additions & 0 deletions
25
...gin-component/src/__tests__/fixtures/wire-decorator/decorator-on-getter-alone/expected.js
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,25 @@ | ||
import { registerDecorators as _registerDecorators, LightningElement, registerComponent as _registerComponent } from "lwc"; | ||
import _tmpl from "./test.html"; | ||
import { Foo } from "data-service"; | ||
class Test extends LightningElement { | ||
get wiredProp() { | ||
return this._wiredProp; | ||
} | ||
/*LWC compiler vX.X.X*/ | ||
} | ||
_registerDecorators(Test, { | ||
wire: { | ||
wiredProp: { | ||
adapter: Foo, | ||
config: function ($cmp) { | ||
return {}; | ||
} | ||
} | ||
} | ||
}); | ||
const __lwc_component_class_internal = _registerComponent(Test, { | ||
tmpl: _tmpl, | ||
sel: "lwc-test", | ||
apiVersion: 9999999 | ||
}); | ||
export default __lwc_component_class_internal; |
12 changes: 12 additions & 0 deletions
12
...abel-plugin-component/src/__tests__/fixtures/wire-decorator/decorator-on-getter/actual.js
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 @@ | ||
import { wire, LightningElement } from "lwc"; | ||
import { Foo } from "data-service"; | ||
export default class Test extends LightningElement { | ||
@wire(Foo) | ||
get wiredProp () { | ||
return this._wiredProp | ||
} | ||
|
||
set wiredProp (val) { | ||
this._wiredProp = val | ||
} | ||
} |
Empty file.
28 changes: 28 additions & 0 deletions
28
...el-plugin-component/src/__tests__/fixtures/wire-decorator/decorator-on-getter/expected.js
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,28 @@ | ||
import { registerDecorators as _registerDecorators, LightningElement, registerComponent as _registerComponent } from "lwc"; | ||
import _tmpl from "./test.html"; | ||
import { Foo } from "data-service"; | ||
class Test extends LightningElement { | ||
get wiredProp() { | ||
return this._wiredProp; | ||
} | ||
set wiredProp(val) { | ||
this._wiredProp = val; | ||
} | ||
/*LWC compiler vX.X.X*/ | ||
} | ||
_registerDecorators(Test, { | ||
wire: { | ||
wiredProp: { | ||
adapter: Foo, | ||
config: function ($cmp) { | ||
return {}; | ||
} | ||
} | ||
} | ||
}); | ||
const __lwc_component_class_internal = _registerComponent(Test, { | ||
tmpl: _tmpl, | ||
sel: "lwc-test", | ||
apiVersion: 9999999 | ||
}); | ||
export default __lwc_component_class_internal; |
8 changes: 8 additions & 0 deletions
8
...lugin-component/src/__tests__/fixtures/wire-decorator/decorator-on-setter-alone/actual.js
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 @@ | ||
import { wire, LightningElement } from "lwc"; | ||
import { Foo } from "data-service"; | ||
export default class Test extends LightningElement { | ||
@wire(Foo) | ||
set wiredProp (val) { | ||
this._wiredProp = val | ||
} | ||
} |
Empty file.
25 changes: 25 additions & 0 deletions
25
...gin-component/src/__tests__/fixtures/wire-decorator/decorator-on-setter-alone/expected.js
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,25 @@ | ||
import { registerDecorators as _registerDecorators, LightningElement, registerComponent as _registerComponent } from "lwc"; | ||
import _tmpl from "./test.html"; | ||
import { Foo } from "data-service"; | ||
class Test extends LightningElement { | ||
set wiredProp(val) { | ||
this._wiredProp = val; | ||
} | ||
/*LWC compiler vX.X.X*/ | ||
} | ||
_registerDecorators(Test, { | ||
wire: { | ||
wiredProp: { | ||
adapter: Foo, | ||
config: function ($cmp) { | ||
return {}; | ||
} | ||
} | ||
} | ||
}); | ||
const __lwc_component_class_internal = _registerComponent(Test, { | ||
tmpl: _tmpl, | ||
sel: "lwc-test", | ||
apiVersion: 9999999 | ||
}); | ||
export default __lwc_component_class_internal; |
8 changes: 8 additions & 0 deletions
8
...abel-plugin-component/src/__tests__/fixtures/wire-decorator/decorator-on-setter/actual.js
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 @@ | ||
import { wire, LightningElement } from "lwc"; | ||
import { Foo } from "data-service"; | ||
export default class Test extends LightningElement { | ||
@wire(Foo) | ||
set wiredProp (val) { | ||
this._wiredProp = val | ||
} | ||
} |
Empty file.
25 changes: 25 additions & 0 deletions
25
...el-plugin-component/src/__tests__/fixtures/wire-decorator/decorator-on-setter/expected.js
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,25 @@ | ||
import { registerDecorators as _registerDecorators, LightningElement, registerComponent as _registerComponent } from "lwc"; | ||
import _tmpl from "./test.html"; | ||
import { Foo } from "data-service"; | ||
class Test extends LightningElement { | ||
set wiredProp(val) { | ||
this._wiredProp = val; | ||
} | ||
/*LWC compiler vX.X.X*/ | ||
} | ||
_registerDecorators(Test, { | ||
wire: { | ||
wiredProp: { | ||
adapter: Foo, | ||
config: function ($cmp) { | ||
return {}; | ||
} | ||
} | ||
} | ||
}); | ||
const __lwc_component_class_internal = _registerComponent(Test, { | ||
tmpl: _tmpl, | ||
sel: "lwc-test", | ||
apiVersion: 9999999 | ||
}); | ||
export default __lwc_component_class_internal; |