Skip to content

Commit db73a4c

Browse files
614: Code refactoring
1 parent 45e39ca commit db73a4c

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

tests/com/magento/idea/magento2plugin/reference/js/RequireJsReferenceRegistrarTest.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,45 @@
22
* Copyright © Magento, Inc. All rights reserved.
33
* See COPYING.txt for license details.
44
*/
5+
56
package com.magento.idea.magento2plugin.reference.js;
67

78
public class RequireJsReferenceRegistrarTest extends ReferenceJsFixtureTestCase {
89

10+
private static final String FIXTURE_PATH = "test.js";
11+
12+
/**
13+
* Mapped parameters should have reference to file.
14+
*/
915
public void testMappedInjectionParameterMustHaveReference() {
10-
String filePath = this.getFixturePath("test.js");
11-
myFixture.configureByFile(filePath);
16+
myFixture.configureByFile(getFixturePath(FIXTURE_PATH));
1217

1318
assertHasReferenceToFile("app/code/Foo/Bar/view/frontend/web/js/file.js");
1419
}
1520

21+
/**
22+
* Path parameters should have reference to file.
23+
*/
1624
public void testPathInjectionParameterMustHaveReference() {
17-
String filePath = this.getFixturePath("test.js");
18-
myFixture.configureByFile(filePath);
25+
myFixture.configureByFile(getFixturePath(FIXTURE_PATH));
1926

2027
assertHasReferenceToFile("app/code/Foo/Bar/view/frontend/web/js/file2.js");
2128
}
2229

30+
/**
31+
* The Magento resource file path parameters should have reference to file.
32+
*/
2333
public void testFileInjectionParameterMustHaveReference() {
24-
String filePath = this.getFixturePath("test.js");
25-
myFixture.configureByFile(filePath);
34+
myFixture.configureByFile(getFixturePath(FIXTURE_PATH));
2635

2736
assertHasReferenceToFile("app/code/Foo/Bar/view/frontend/web/js/file.js");
2837
}
2938

39+
/**
40+
* Lib resource parameters should have reference to file.
41+
*/
3042
public void testLibInjectionParameterMustHaveReference() {
31-
String filePath = this.getFixturePath("test.js");
32-
myFixture.configureByFile(filePath);
43+
myFixture.configureByFile(getFixturePath(FIXTURE_PATH));
3344

3445
assertHasReferenceToFile("/lib/web/testjs.js");
3546
}

0 commit comments

Comments
 (0)