|
2 | 2 | * Copyright © Magento, Inc. All rights reserved.
|
3 | 3 | * See COPYING.txt for license details.
|
4 | 4 | */
|
| 5 | + |
5 | 6 | package com.magento.idea.magento2plugin.reference.js;
|
6 | 7 |
|
7 | 8 | public class RequireJsReferenceRegistrarTest extends ReferenceJsFixtureTestCase {
|
8 | 9 |
|
| 10 | + private static final String FIXTURE_PATH = "test.js"; |
| 11 | + |
| 12 | + /** |
| 13 | + * Mapped parameters should have reference to file. |
| 14 | + */ |
9 | 15 | public void testMappedInjectionParameterMustHaveReference() {
|
10 |
| - String filePath = this.getFixturePath("test.js"); |
11 |
| - myFixture.configureByFile(filePath); |
| 16 | + myFixture.configureByFile(getFixturePath(FIXTURE_PATH)); |
12 | 17 |
|
13 | 18 | assertHasReferenceToFile("app/code/Foo/Bar/view/frontend/web/js/file.js");
|
14 | 19 | }
|
15 | 20 |
|
| 21 | + /** |
| 22 | + * Path parameters should have reference to file. |
| 23 | + */ |
16 | 24 | public void testPathInjectionParameterMustHaveReference() {
|
17 |
| - String filePath = this.getFixturePath("test.js"); |
18 |
| - myFixture.configureByFile(filePath); |
| 25 | + myFixture.configureByFile(getFixturePath(FIXTURE_PATH)); |
19 | 26 |
|
20 | 27 | assertHasReferenceToFile("app/code/Foo/Bar/view/frontend/web/js/file2.js");
|
21 | 28 | }
|
22 | 29 |
|
| 30 | + /** |
| 31 | + * The Magento resource file path parameters should have reference to file. |
| 32 | + */ |
23 | 33 | public void testFileInjectionParameterMustHaveReference() {
|
24 |
| - String filePath = this.getFixturePath("test.js"); |
25 |
| - myFixture.configureByFile(filePath); |
| 34 | + myFixture.configureByFile(getFixturePath(FIXTURE_PATH)); |
26 | 35 |
|
27 | 36 | assertHasReferenceToFile("app/code/Foo/Bar/view/frontend/web/js/file.js");
|
28 | 37 | }
|
29 | 38 |
|
| 39 | + /** |
| 40 | + * Lib resource parameters should have reference to file. |
| 41 | + */ |
30 | 42 | public void testLibInjectionParameterMustHaveReference() {
|
31 |
| - String filePath = this.getFixturePath("test.js"); |
32 |
| - myFixture.configureByFile(filePath); |
| 43 | + myFixture.configureByFile(getFixturePath(FIXTURE_PATH)); |
33 | 44 |
|
34 | 45 | assertHasReferenceToFile("/lib/web/testjs.js");
|
35 | 46 | }
|
|
0 commit comments