diff --git a/e2e/file-qualifiers/app/App_Resources/Android/src/main/res/values/strings.xml b/e2e/file-qualifiers/app/App_Resources/Android/src/main/res/values/strings.xml
index 3b60905d1..d35397e8b 100644
--- a/e2e/file-qualifiers/app/App_Resources/Android/src/main/res/values/strings.xml
+++ b/e2e/file-qualifiers/app/App_Resources/Android/src/main/res/values/strings.xml
@@ -1,5 +1,5 @@
- TestApp
- TestApp
+ FileQualifiers
+ FileQualifiers
\ No newline at end of file
diff --git a/e2e/file-qualifiers/app/app.css b/e2e/file-qualifiers/app/app.css
index 96036dd59..92be534e4 100644
--- a/e2e/file-qualifiers/app/app.css
+++ b/e2e/file-qualifiers/app/app.css
@@ -1,3 +1,5 @@
+@import '~nativescript-theme-core/css/core.light.css';
+
.root-footer {
color: black;
background-color: lightgreen
diff --git a/e2e/file-qualifiers/app/app.land.css b/e2e/file-qualifiers/app/app.land.css
index 327ff04f5..fea0a142f 100644
--- a/e2e/file-qualifiers/app/app.land.css
+++ b/e2e/file-qualifiers/app/app.land.css
@@ -1,3 +1,6 @@
+/* Currently app.land.css is never loaded */
+@import '~nativescript-theme-core/css/lime.css';
+
.root-footer {
color: black;
background-color: lightpink;
diff --git a/e2e/file-qualifiers/app/main/main-page.land.xml b/e2e/file-qualifiers/app/main/main-page.land.xml
index ccf5350b5..386d9cc42 100644
--- a/e2e/file-qualifiers/app/main/main-page.land.xml
+++ b/e2e/file-qualifiers/app/main/main-page.land.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/e2e/file-qualifiers/app/main/main-page.xml b/e2e/file-qualifiers/app/main/main-page.xml
index 5d00c932b..6b9308f3a 100644
--- a/e2e/file-qualifiers/app/main/main-page.xml
+++ b/e2e/file-qualifiers/app/main/main-page.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/e2e/file-qualifiers/app/other/other-page.land.xml b/e2e/file-qualifiers/app/other/other-page.land.xml
index 82ad97fae..46a9a46e4 100644
--- a/e2e/file-qualifiers/app/other/other-page.land.xml
+++ b/e2e/file-qualifiers/app/other/other-page.land.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/e2e/file-qualifiers/app/other/other-page.xml b/e2e/file-qualifiers/app/other/other-page.xml
index e1dccd85e..31f2cca17 100644
--- a/e2e/file-qualifiers/app/other/other-page.xml
+++ b/e2e/file-qualifiers/app/other/other-page.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/e2e/file-qualifiers/nsconfig.json b/e2e/file-qualifiers/nsconfig.json
index a6d75472c..9e26dfeeb 100644
--- a/e2e/file-qualifiers/nsconfig.json
+++ b/e2e/file-qualifiers/nsconfig.json
@@ -1,3 +1 @@
-{
- "useLegacyWorkflow": false
-}
\ No newline at end of file
+{}
\ No newline at end of file
diff --git a/e2e/file-qualifiers/package.json b/e2e/file-qualifiers/package.json
index a10f98556..a385d4fb7 100644
--- a/e2e/file-qualifiers/package.json
+++ b/e2e/file-qualifiers/package.json
@@ -6,18 +6,19 @@
"nativescript": {
"id": "org.nativescript.filequalifiers",
"tns-ios": {
- "version": "6.0.0-2019-06-19-084246-01"
+ "version": "next"
},
"tns-android": {
- "version": "6.0.0-2019-06-24-113546-01"
+ "version": "next"
}
},
"dependencies": {
+ "nativescript-theme-core": "^1.0.6",
"tns-core-modules": "file:../../tns-core-modules"
},
"devDependencies": {
"nativescript-dev-webpack": "next",
"tns-platform-declarations": "next",
- "typescript": "3.4.1"
+ "typescript": "3.4.5"
}
}
diff --git a/e2e/file-qualifiers/webpack.config.js b/e2e/file-qualifiers/webpack.config.js
index d06082709..d677fa3b9 100644
--- a/e2e/file-qualifiers/webpack.config.js
+++ b/e2e/file-qualifiers/webpack.config.js
@@ -28,7 +28,6 @@ module.exports = env => {
// Default destination inside platforms//...
const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));
- const appResourcesPlatformDir = platform === "android" ? "Android" : "iOS";
const {
// The 'appPath' and 'appResourcesPath' values are fetched from
@@ -73,6 +72,7 @@ module.exports = env => {
itemsToClean.push(`${join(projectRoot, "platforms", "android", "app", "build", "configurations", "nativescript-android-snapshot")}`);
}
+ nsWebpack.processAppComponents(appComponents, platform);
const config = {
mode: production ? "production" : "development",
context: appFullPath,
@@ -133,6 +133,7 @@ module.exports = env => {
test: (module, chunks) => {
const moduleName = module.nameForCondition ? module.nameForCondition() : '';
return /[\\/]node_modules[\\/]/.test(moduleName) ||
+ /[\\/]tns-core-modules[\\/]/.test(moduleName) || // <-- Needed for snapshot builds with linked modules!
appComponents.some(comp => comp === moduleName);
},
@@ -179,13 +180,14 @@ module.exports = env => {
unitTesting,
appFullPath,
projectRoot,
+ ignoredFiles: nsWebpack.getUserDefinedEntries(entries, platform)
}
},
].filter(loader => !!loader)
},
-
+
{
- test: /\.(ts|css|scss|less|html|xml)$/,
+ test: /\.(ts|css|scss|html|xml)$/,
use: "nativescript-dev-webpack/hmr/hot-loader"
},
@@ -227,7 +229,7 @@ module.exports = env => {
// Define useful constants like TNS_WEBPACK
new webpack.DefinePlugin({
"global.TNS_WEBPACK": "true",
- "process": undefined,
+ "process": "global.process",
}),
// Remove all files from the out dir.
new CleanWebpackPlugin(itemsToClean, { verbose: !!verbose }),
diff --git a/e2e/ui-tests-app/app/layouts/grid-7295-page.ts b/e2e/ui-tests-app/app/layouts/grid-7295-page.ts
new file mode 100644
index 000000000..992deed64
--- /dev/null
+++ b/e2e/ui-tests-app/app/layouts/grid-7295-page.ts
@@ -0,0 +1,45 @@
+import * as model from "./myview";
+import { Button } from "tns-core-modules/ui/button";
+import { Page } from "tns-core-modules/ui/page";
+import { GridLayout, ItemSpec } from "tns-core-modules/ui/layouts/grid-layout";
+
+export function onLoaded(args: { eventName: string, object: any }) {
+ var page = args.object;
+ page.bindingContext = new model.ViewModel();
+}
+
+export function onAddRowColumn(args: { eventName: string, object: any }) {
+
+ var layout = args.object.parent.parent;
+ var row = new ItemSpec(1, "auto");
+ var column = new ItemSpec(1, "auto");
+
+ layout.addRow(row);
+ layout.addColumn(column);
+
+ var btn0 = new Button();
+ var btn1 = new Button();
+ btn0.id = "b0";
+ btn1.id = "b1";
+ btn0.text = "b0";
+ btn1.text = "b1";
+ layout.addChild(btn0);
+ layout.addChild(btn1);
+ GridLayout.setRow(btn0, 0);
+ GridLayout.setColumn(btn0, 4);
+ GridLayout.setRow(btn1, 4);
+ GridLayout.setColumn(btn1, 0);
+ GridLayout.setColumnSpan(btn1, 2);
+ GridLayout.setRowSpan(btn0, 3);
+}
+
+export function onRemoveRowColumn(args: { eventName: string, object: any }) {
+ var layout = args.object.parent.parent;
+ var itemSpecs, count;
+ itemSpecs = layout.getRows();
+ count = itemSpecs.length;
+ layout.removeRow(itemSpecs[count - 1]);
+ itemSpecs = layout.getColumns();
+ count = itemSpecs.length;
+ layout.removeColumn(itemSpecs[count - 1]);
+}
diff --git a/e2e/ui-tests-app/app/layouts/grid-7295-page.xml b/e2e/ui-tests-app/app/layouts/grid-7295-page.xml
new file mode 100644
index 000000000..1a7ceb5db
--- /dev/null
+++ b/e2e/ui-tests-app/app/layouts/grid-7295-page.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/e2e/ui-tests-app/app/layouts/main-page.ts b/e2e/ui-tests-app/app/layouts/main-page.ts
index 6534b9bf0..cad26d65e 100644
--- a/e2e/ui-tests-app/app/layouts/main-page.ts
+++ b/e2e/ui-tests-app/app/layouts/main-page.ts
@@ -23,6 +23,7 @@ export function loadExamples() {
examples.set("pwrap", "layouts-percent/wrap-page");
examples.set("passThroughParent", "layouts/passThroughParent-page");
examples.set("stacklayout-6059", "layouts/stacklayout-6059-page");
+ examples.set("grid-7295", "layouts/grid-7295-page");
examples.set("safe-area", "layouts/safe-area-page");
return examples;
diff --git a/tests/app/timer/timer-tests.ts b/tests/app/timer/timer-tests.ts
index c8c8a55d6..2c6f7997f 100644
--- a/tests/app/timer/timer-tests.ts
+++ b/tests/app/timer/timer-tests.ts
@@ -72,6 +72,23 @@ export function test_setTimeout_callbackCalledAfterSpecifiedTime() {
TKUnit.assert(completed, "Callback should be called after the specified time!");
}
+export function test_setTimeout_callbackCalledWithBooleanPeriod() {
+ let completed = false;
+
+ // >> timer-set-false
+ const id = timer.setTimeout(() => {
+ // >> (hide)
+ completed = true;
+ // << (hide)
+ // @ts-ignore
+ }, false);
+ // << timer-set-false
+
+ TKUnit.waitUntilReady(() => completed, 1);
+ timer.clearTimeout(id);
+ TKUnit.assert(completed, "Callback should be called in 0 seconds!");
+}
+
export function test_setTimeout_callbackNotCalled() {
let completed = false;
diff --git a/tests/app/ui/label/label-tests.ts b/tests/app/ui/label/label-tests.ts
index cfd846e45..17b344750 100644
--- a/tests/app/ui/label/label-tests.ts
+++ b/tests/app/ui/label/label-tests.ts
@@ -556,16 +556,15 @@ export class LabelTest extends testModule.UITest {
TKUnit.assertEqual(actualResult, this.expectedTextAlignment);
}
- // TODO: fix this, broken with https://github.com/NativeScript/NativeScript/pull/7499
- // public testErrorMessageWhenWrongCssIsAddedWithFile() {
- // const view = this.testView;
- // const page = this.testPage;
- // this.waitUntilTestElementIsLoaded();
+ public testErrorMessageWhenWrongCssIsAddedWithFile() {
+ const view = this.testView;
+ const page = this.testPage;
+ this.waitUntilTestElementIsLoaded();
- // view.id = "testLabel";
- // page.addCssFile(fs.path.join(testDir, "label-tests-wrong-page.css"));
- // TKUnit.assertNotEqual(this.errorMessage, undefined);
- // }
+ view.id = "testLabel";
+ page.addCssFile(fs.path.join(testDir, "label-tests-wrong-page.css"));
+ TKUnit.assertNotEqual(this.errorMessage, undefined);
+ }
public testErrorMessageWhenWrongCssIsAdded() {
const view = this.testView;
diff --git a/tests/app/ui/layouts/grid-layout-tests.ts b/tests/app/ui/layouts/grid-layout-tests.ts
index a57a243a9..57a2d9538 100644
--- a/tests/app/ui/layouts/grid-layout-tests.ts
+++ b/tests/app/ui/layouts/grid-layout-tests.ts
@@ -119,6 +119,60 @@ export class GridLayoutTest extends testModule.UITest
TKUnit.assertEqual(this.colSpan(test), 1, "'columnSpan' property default value should be 1.");
}
+ public test_synonym_property_setting_column_changes_col() {
+ const test = new Button();
+
+ test.column = 3;
+
+ TKUnit.assertEqual(test.column, 3, "Setting column should work.");
+ TKUnit.assertEqual(test.col, 3, "Setting column property should affect col property.");
+ }
+
+ public test_synonym_property_setting_col_changes_column() {
+ const test = new Button();
+
+ test.col = 3;
+
+ TKUnit.assertEqual(test.col, 3, "Setting col should work.");
+ TKUnit.assertEqual(test.column, 3, "Setting col property should affect column property.");
+ }
+
+ public test_synonym_property_setColumn_should_set_col_and_column() {
+ const test = new Button();
+
+ GridLayout.setColumn(test, 3);
+
+ TKUnit.assertEqual(test.col, 3, "setColumn should set col");
+ TKUnit.assertEqual(test.column, 3, "setColumn should set column");
+ }
+
+ public test_synonym_property_setting_columnSpan_changes_colSpan() {
+ const test = new Button();
+
+ test.columnSpan = 3;
+
+ TKUnit.assertEqual(test.columnSpan, 3, "Setting columnSpan should work.");
+ TKUnit.assertEqual(test.colSpan, 3, "Setting columnSpan property should affect colSpan property.");
+ }
+
+ public test_synonym_property_setting_colSpan_changes_columnSpan() {
+ const test = new Button();
+
+ test.colSpan = 3;
+
+ TKUnit.assertEqual(test.colSpan, 3, "Setting colSpan should work.");
+ TKUnit.assertEqual(test.columnSpan, 3, "Setting colSpan property should affect columnSpan property.");
+ }
+
+ public test_synonym_property_setColumnSpan_should_set_colSpan_and_columnSpan() {
+ const test = new Button();
+
+ GridLayout.setColumnSpan(test, 3);
+
+ TKUnit.assertEqual(test.colSpan, 3, "setColumnSpan should set colSpan");
+ TKUnit.assertEqual(test.columnSpan, 3, "setColumnSpan should set columnSpan");
+ }
+
public test_getRow_shouldThrow_onNullValues() {
TKUnit.assertThrows(() => {
GridLayout.getRow(null);
@@ -250,17 +304,17 @@ export class GridLayoutTest extends testModule.UITest
TKUnit.assertEqual(
this.row(btn),
row,
- "'row' property not applied For GridLayout addChildAtCell without rowspan."
+ "'row' property not applied For GridLayout addChildAtCell without rowSpan."
);
TKUnit.assertEqual(
this.col(btn),
column,
- "'column' property not applied For GridLayout addChildAtCell without rowspan."
+ "'column' property not applied For GridLayout addChildAtCell without rowSpan."
);
TKUnit.assertEqual(
this.rowSpan(btn),
defaultSpanValue,
- "'rowSpan' property not applied For GridLayout addChildAtCell without rowspan."
+ "'rowSpan' property not applied For GridLayout addChildAtCell without rowSpan."
);
TKUnit.assertEqual(
this.colSpan(btn),
diff --git a/tests/app/xml-parser-tests/xml-parser-tests.ts b/tests/app/xml-parser-tests/xml-parser-tests.ts
index 8bf019713..e1949ba1c 100644
--- a/tests/app/xml-parser-tests/xml-parser-tests.ts
+++ b/tests/app/xml-parser-tests/xml-parser-tests.ts
@@ -54,6 +54,32 @@ export var test_XmlParser_EntityReferencesInAttributeValuesAreDecoded = function
TKUnit.assert(data === "<>\"&'", "Expected result: <>\"&'; Actual result: " + data + ";");
};
+export var test_XmlParser_UnicodeEntitiesAreDecoded = function () {
+ var data;
+ var xmlParser = new xmlModule.XmlParser(function (event: xmlModule.ParserEvent) {
+ switch (event.eventType) {
+ case xmlModule.ParserEventType.Text:
+ data = event.data;
+ break;
+ }
+ });
+ xmlParser.parse("🤣✓");
+ TKUnit.assert(data === "\uD83E\uDD23\u2713", "Expected result: \uD83E\uDD23\u2713; Actual result: " + data + ";");
+};
+
+export var test_XmlParser_UnicodeEntitiesInAttributeValuesAreDecoded = function () {
+ var data;
+ var xmlParser = new xmlModule.XmlParser(function (event: xmlModule.ParserEvent) {
+ switch (event.eventType) {
+ case xmlModule.ParserEventType.StartElement:
+ data = event.attributes["text"];
+ break;
+ }
+ });
+ xmlParser.parse("