This repository has been archived by the owner on Jan 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kamil Kisiela
committed
Dec 18, 2015
1 parent
5de2fda
commit 956c12d
Showing
22 changed files
with
923 additions
and
974 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ import './../src'; | |
|
||
import './helpers'; | ||
import './runs'; | ||
import './types' | ||
import './types'; | ||
import './wrappers'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import testUtils from './../test-utils'; | ||
|
||
describe('formlyMaterial - textarea no autogrow manipulator', () => { | ||
// | ||
// vars | ||
// | ||
let $compile; | ||
let $rootScope; | ||
let $scope; | ||
let element; | ||
|
||
// | ||
// helpers | ||
// | ||
|
||
function compile(options) { | ||
$scope = $rootScope.$new(); | ||
$scope.fields = [angular.merge({}, { | ||
key: 'testField', | ||
type: 'textarea', | ||
templateOptions: { | ||
label: 'test field', | ||
grow: false | ||
} | ||
}, options)]; | ||
|
||
const form = $compile(testUtils.getFormTemplate())($scope); | ||
|
||
$scope.$digest(); | ||
element = form.find('[ng-model]'); | ||
} | ||
|
||
// | ||
// tests | ||
// | ||
|
||
beforeEach(() => { | ||
window.module('formlyMaterial'); | ||
|
||
inject((_$compile_, _$rootScope_) => { | ||
$compile = _$compile_; | ||
$rootScope = _$rootScope_; | ||
}); | ||
|
||
compile(); | ||
}); | ||
|
||
it('should be able to add md-no-autogrow attribute when grow equals false', () => { | ||
compile(); | ||
expect(element.attr('md-no-autogrow')).toBeDefined(); | ||
}); | ||
|
||
it('should not add md-no-autogrow on non textarea type', () => { | ||
compile({ | ||
type: 'input' | ||
}); | ||
expect(element.attr('md-no-autogrow')).toBeUndefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import './md-theme-manipulator-spec'; | ||
import './md-no-autogrow-spec'; | ||
import './theme-spec'; | ||
import './grow-spec'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import testUtils from './../test-utils'; | ||
|
||
describe('formlyMaterial - theme manipulator', () => { | ||
// | ||
// vars | ||
// | ||
let $compile; | ||
let $rootScope; | ||
let $scope; | ||
let element; | ||
|
||
// | ||
// helpers | ||
// | ||
|
||
function compile(options) { | ||
$scope = $rootScope.$new(); | ||
$scope.fields = [angular.merge({}, { | ||
key: 'testField', | ||
type: 'switch', | ||
templateOptions: { | ||
theme: 'custom', | ||
label: 'test field' | ||
} | ||
}, options)]; | ||
|
||
const form = $compile(testUtils.getFormTemplate())($scope); | ||
|
||
$scope.$digest(); | ||
element = form.find('[ng-model]'); | ||
} | ||
|
||
// | ||
// tests | ||
// | ||
|
||
beforeEach(() => { | ||
window.module('formlyMaterial'); | ||
|
||
inject((_$compile_, _$rootScope_) => { | ||
$compile = _$compile_; | ||
$rootScope = _$rootScope_; | ||
}); | ||
|
||
compile(); | ||
}); | ||
|
||
it('should be able to add md-theme attribute', () => { | ||
compile(); | ||
expect(element.attr('md-theme')).toBe('custom'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export default class testUtils { | ||
static getFormTemplate() { | ||
return `<form name="testForm"><formly-form fields="fields" form="testForm"></formly-form></form>`; | ||
} | ||
}; | ||
static getFormTemplate() { | ||
return `<form name="testForm"><formly-form fields="fields" form="testForm"></formly-form></form>`; | ||
} | ||
} |
Oops, something went wrong.