Skip to content

Commit fb5c97c

Browse files
VladimirAmiorkovMartoYankov
authored andcommitted
fix-next(css): CSS not applied to "drawerContent" when RadSideDrawer is used as root (NativeScript#5466)
* fix(XMLBuilder): Pass the "module path name" when building "custom component" * test(root-view): root view css applied tests
1 parent 9ce0819 commit fb5c97c

File tree

14 files changed

+148
-7
lines changed

14 files changed

+148
-7
lines changed

tests/app/testRunner.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,21 +225,24 @@ allTests["ANIMATION"] = animationTests;
225225
import * as lifecycle from "./ui/lifecycle/lifecycle-tests";
226226
allTests["LIFECYCLE"] = lifecycle;
227227

228-
229228
import * as cssAnimationTests from "./ui/animation/css-animation-tests";
230229
allTests["CSS-ANIMATION"] = cssAnimationTests;
231230

232231
import * as transitionTests from "./navigation/transition-tests";
233232
allTests["TRANSITIONS"] = transitionTests;
233+
234234
import * as searchBarTests from "./ui/search-bar/search-bar-tests";
235235
allTests["SEARCH-BAR"] = searchBarTests;
236236

237237
import * as navigationTests from "./navigation/navigation-tests";
238238
allTests["NAVIGATION"] = navigationTests;
239239

240-
import * as resetRootViewTests from "./navigation/reset-root-view-tests";
240+
import * as resetRootViewTests from "./ui/root-view/reset-root-view-tests";
241241
allTests["RESET-ROOT-VIEW"] = resetRootViewTests;
242242

243+
import * as rootViewTests from "./ui/root-view/root-view-tests";
244+
allTests["ROOT-VIEW"] = rootViewTests;
245+
243246
const testsSuitesWithLongDelay = {
244247
HTTP: 15 * 1000,
245248
}

tests/app/ui/helper.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ export function assertViewBackgroundColor(testView: ViewBase, hexColor: string)
215215
TKUnit.assertEqual(testView.style.backgroundColor.hex, hexColor, "backgroundColor property");
216216
}
217217

218+
export function assertTabSelectedTabTextColor(testView: ViewBase, hexColor: string) {
219+
TKUnit.assert(testView.style.selectedTabTextColor, "selectedTabTextColor property not applied correctly. Style value is not defined.");
220+
TKUnit.assertEqual(testView.style.selectedTabTextColor.hex, hexColor, "selectedTabTextColor property not applied correctly");
221+
}
222+
218223
export function forceGC() {
219224
if (isIOS) {
220225
/* tslint:disable:no-unused-expression */
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.MyStackLayout {
2+
background-color: red;
3+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import * as observable from "tns-core-modules/data/observable";
2+
import * as stackLayoutModule from "tns-core-modules/ui/layouts/stack-layout";
3+
import * as label from "tns-core-modules/ui/label";
4+
import * as button from "tns-core-modules/ui/button";
5+
6+
export class MyControl extends stackLayoutModule.StackLayout {
7+
constructor() {
8+
super();
9+
10+
var counter: number = 0;
11+
12+
var lbl = new label.Label();
13+
var btn = new button.Button();
14+
btn.text = "Tap me!";
15+
btn.on(button.Button.tapEvent, (args: observable.EventData) => {
16+
lbl.text = "Tap " + counter++;
17+
});
18+
19+
this.addChild(lbl);
20+
this.addChild(btn);
21+
22+
this.className = "MyStackLayout";
23+
}
24+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{ "name" : "MyControl",
2+
"main" : "MyControl.js" }

tests/app/navigation/reset-root-view-tests.ts renamed to tests/app/ui/root-view/reset-root-view-tests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as TKUnit from "../TKUnit";
2-
import * as helper from "../ui/helper";
1+
import * as TKUnit from "../../TKUnit";
2+
import * as helper from "../helper";
33
import { Page } from "tns-core-modules/ui/page";
44
import { Frame, NavigationEntry, stack } from "tns-core-modules/ui/frame";
55
import { _resetRootView, getRootView } from "tns-core-modules/application";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.MyStackLayoutRoot {
2+
background-color: blue;
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<customControls:MyControl xmlns:customControls="ui/root-view/mymodule" class="MyStackLayoutRoot">
2+
</customControls:MyControl>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.MyStackLayoutRoot {
2+
background-color: blue;
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<GridLayout class="MyStackLayoutRoot">
2+
</GridLayout>

0 commit comments

Comments
 (0)