aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ngScenario/SpecRunnerSpec.js1
-rw-r--r--test/ngScenario/dslSpec.js38
2 files changed, 38 insertions, 1 deletions
diff --git a/test/ngScenario/SpecRunnerSpec.js b/test/ngScenario/SpecRunnerSpec.js
index c104a9b7..5970607c 100644
--- a/test/ngScenario/SpecRunnerSpec.js
+++ b/test/ngScenario/SpecRunnerSpec.js
@@ -173,5 +173,4 @@ describe('angular.scenario.SpecRunner', function() {
'SpecEnd'
]);
});
-
});
diff --git a/test/ngScenario/dslSpec.js b/test/ngScenario/dslSpec.js
index eef8c907..6d87e850 100644
--- a/test/ngScenario/dslSpec.js
+++ b/test/ngScenario/dslSpec.js
@@ -217,6 +217,30 @@ describe("angular.scenario.dsl", function() {
expect(doc.find('[ng-model="test"]').val()).toEqual('A');
});
+ it('should select single option using data-ng', function() {
+ doc.append(
+ '<select data-ng-model="test">' +
+ ' <option value=A>one</option>' +
+ ' <option value=B selected>two</option>' +
+ '</select>'
+ );
+ $root.dsl.select('test').option('A');
+ expect(doc.find('[data-ng-model="test"]').val()).toEqual('A');
+ });
+ it('should select single option using x-ng', function() {
+ doc.append(
+ '<select x-ng-model="test">' +
+ ' <option value=A>one</option>' +
+ ' <option value=B selected>two</option>' +
+ '</select>'
+ );
+ $root.dsl.select('test').option('A');
+ expect(doc.find('[x-ng-model="test"]').val()).toEqual('A');
+ });
+
+
+
+
it('should select option by name', function() {
doc.append(
'<select ng-model="test">' +
@@ -542,6 +566,20 @@ describe("angular.scenario.dsl", function() {
chain.enter('foo');
expect(_jQuery('input[ng-model="test.input"]').val()).toEqual('foo');
});
+ it('should change value in text input in data-ng form', function() {
+ doc.append('<input data-ng-model="test.input" value="something">');
+ var chain = $root.dsl.input('test.input');
+ chain.enter('foo');
+ expect(_jQuery('input[data-ng-model="test.input"]').val()).toEqual('foo');
+ });
+ it('should change value in text input in x-ng form', function() {
+ doc.append('<input x-ng-model="test.input" value="something">');
+ var chain = $root.dsl.input('test.input');
+ chain.enter('foo');
+ expect(_jQuery('input[x-ng-model="test.input"]').val()).toEqual('foo');
+ });
+
+
it('should return error if no input exists', function() {
var chain = $root.dsl.input('test.input');