-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Oleksii Kurinnyi <[email protected]>
- Loading branch information
Oleksii Kurinnyi
committed
Feb 28, 2017
1 parent
009a79d
commit 85bc215
Showing
2 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
dashboard/src/components/attribute/input-type/input-city.spec.ts
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,50 @@ | ||
/* | ||
* Copyright (c) 2015-2017 Codenvy, S.A. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Codenvy, S.A. - initial API and implementation | ||
*/ | ||
'use strict'; | ||
import {CheTypeCity} from './input-city.directive'; | ||
|
||
/** | ||
* Test for CheTypeCity class. | ||
* | ||
* @author Oleksii Kurinnyi | ||
*/ | ||
|
||
describe('CheTypeCity', () => { | ||
let cheTypeCity: CheTypeCity; | ||
|
||
let validSymbols = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.\' '; | ||
let invalidSymbols = '`~!@#$%^&*()[]{}<>_+=:;?0123456789'; | ||
|
||
beforeEach(() => { | ||
cheTypeCity = new CheTypeCity(); | ||
}); | ||
|
||
validSymbols.split('').forEach((validSymbol: string) => { | ||
|
||
(function shouldPass(symbol: string) { | ||
it(`should pass "${symbol}" symbol`, () => { | ||
expect(cheTypeCity.symbolIsValid(symbol)).toBeTruthy(); | ||
}); | ||
})(validSymbol); | ||
|
||
}); | ||
|
||
invalidSymbols.split('').forEach((invalidSymbol: string) => { | ||
|
||
(function (symbol: string) { | ||
it(`should not pass "${symbol}" symbol`, () => { | ||
expect(cheTypeCity.symbolIsValid(symbol)).toBeFalsy(); | ||
}); | ||
})(invalidSymbol); | ||
|
||
}); | ||
|
||
}); |
50 changes: 50 additions & 0 deletions
50
dashboard/src/components/attribute/input-type/input-number.spec.ts
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,50 @@ | ||
/* | ||
* Copyright (c) 2015-2017 Codenvy, S.A. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Codenvy, S.A. - initial API and implementation | ||
*/ | ||
'use strict'; | ||
import {CheTypeNumber} from './input-number.directive'; | ||
|
||
/** | ||
* Test for CheTypeNumber class. | ||
* | ||
* @author Oleksii Kurinnyi | ||
*/ | ||
|
||
describe('CheTypeNumber', () => { | ||
let cheTypeNumber: CheTypeNumber; | ||
|
||
let validSymbols = '0123456789'; | ||
let invalidSymbols = '`~!@#$%^&*()[]{}<>_+=:;.?,/|\'"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | ||
|
||
beforeEach(() => { | ||
cheTypeNumber = new CheTypeNumber(); | ||
}); | ||
|
||
validSymbols.split('').forEach((validSymbol: string) => { | ||
|
||
(function(symbol: string) { | ||
it(`should pass "${symbol}" symbol`, () => { | ||
expect(cheTypeNumber.symbolIsValid(symbol)).toBeTruthy(); | ||
}); | ||
})(validSymbol); | ||
|
||
}); | ||
|
||
invalidSymbols.split('').forEach((invalidSymbol: string) => { | ||
|
||
(function(symbol: string) { | ||
it(`should not pass "${symbol}" symbol`, () => { | ||
expect(cheTypeNumber.symbolIsValid(symbol)).toBeFalsy(); | ||
}); | ||
})(invalidSymbol); | ||
|
||
}); | ||
|
||
}); |