-
Notifications
You must be signed in to change notification settings - Fork 16
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
Showing
29 changed files
with
2,660 additions
and
1,203 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
{ | ||
"presets": [ | ||
"env" | ||
"@babel/preset-env" | ||
], | ||
env: { | ||
test: { | ||
plugins: [ | ||
'@babel/plugin-proposal-class-properties', | ||
] | ||
} | ||
}, | ||
"plugins": [ | ||
"transform-regenerator" | ||
"transform-regenerator", | ||
] | ||
} |
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 @@ | ||
## Description | ||
|
||
A meaningful description of proposed change in your own words. | ||
|
||
## Related Issue | ||
|
||
|
||
## How to test it locally | ||
|
||
|
||
## Screenshots | ||
|
||
|
||
## Changelog | ||
|
||
### Added | ||
|
||
### Updated | ||
|
||
### Removed | ||
|
||
|
||
## Checklist | ||
|
||
- [ ] 🚀 is the code ready to be merged and go live? | ||
- [ ] 🛠 does it work (build) locally | ||
|
||
### Pull Request | ||
|
||
- [ ] 📰 good title | ||
- [ ] 📝good description | ||
- [ ] 🔖 issue linked | ||
- [ ] 📖 changelog filled out | ||
|
||
### Commits | ||
|
||
- [ ] commits are clean | ||
- [ ] commit messages are clean | ||
|
||
### Code Quality | ||
|
||
- [ ] 🚧 no commented out code | ||
- [ ] 🖨 no unnecessary logging | ||
- [ ] 🎱 no magic numbers | ||
- [ ] ⚙️ ran jslint | ||
- [ ] 🧰 ran codeclimate locally | ||
|
||
### Testing | ||
|
||
- [ ] ✅ added (appropriate) unit tests | ||
- [ ] 💢 edge cases in tests were considered | ||
- [ ] ✅ ran tests locally & are passing |
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,21 +1,12 @@ | ||
os: linux | ||
language: python | ||
python: | ||
- "3.7" | ||
addons: | ||
chrome: stable | ||
language: node_js | ||
node_js: | ||
- "14" | ||
cache: | ||
- pip | ||
- yarn: true | ||
- directories: | ||
- node_modules | ||
install: | ||
- pip install -r requirements.txt | ||
services: | ||
- docker | ||
before_script: | ||
- docker-compose up -d | ||
- npm install | ||
script: | ||
- ./run_test.sh | ||
after_script: | ||
- docker-compose down | ||
- npm test |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Controller from '../src/js/controller'; | ||
|
||
describe('Controller', () => { | ||
|
||
it('initialize successully', () => { | ||
let controller = new Controller({}); | ||
}); | ||
describe('Event loop', () => { | ||
it('adds the state to payload', () => { | ||
let controller = new Controller({}); | ||
let result = null; | ||
let payload = "expected" | ||
controller.on('eventname', (e) => result = e) | ||
|
||
controller.triggerEvent('eventname', payload); | ||
|
||
expect(result).toHaveProperty('state') | ||
expect(result).toHaveProperty('payload') | ||
}); | ||
}); | ||
}); | ||
|
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,47 @@ | ||
import {validation, defaultIfMissing} from '../src/js/utils'; | ||
|
||
describe('Testing validation functions', () => { | ||
|
||
|
||
test.each([ | ||
[null, true], [undefined, false], [{}, false], | ||
['', false], [NaN, false]])('.isNull(%s)', (value, expected) => { | ||
expect(validation.isNull(value)).toBe(expected); | ||
}); | ||
|
||
test.each([ | ||
[null, false], [undefined, true], [{}, false], | ||
['', false], [NaN, false]])('.isUndefined(%s)', (value, expected) => { | ||
expect(validation.isUndefined(value)).toBe(expected); | ||
}); | ||
|
||
test.each([ | ||
[null, false], [undefined, false], [{}, false], | ||
['', true], [NaN, false]])('.isEmptyString(%s)', (value, expected) => { | ||
expect(validation.isEmptyString(value)).toBe(expected); | ||
}); | ||
|
||
test.each([ | ||
[null, false], [undefined, false], [{}, true], | ||
['', false], [NaN, false]])('.isEmptyObject(%s)', (value, expected) => { | ||
expect(validation.isEmptyObject(value)).toBe(expected); | ||
}); | ||
|
||
test.each([ | ||
[null, true], [undefined, true], [{}, true], | ||
['', true], [5, false]])('.isMissingData(%s)', (value, expected) => { | ||
expect(validation.isMissingData(value)).toBe(expected); | ||
}); | ||
}); | ||
|
||
describe('Testing defaults', () => { | ||
test('checkAny function works correctly', () => { | ||
expect(defaultIfMissing(5, 5)).toBe(5); | ||
expect(defaultIfMissing('XXX', 5)).toBe('XXX'); | ||
expect(defaultIfMissing(undefined, 5)).toBe(5); | ||
expect(defaultIfMissing(null, 5)).toBe(5); | ||
expect(defaultIfMissing({}, 5)).toBe(5); | ||
expect(defaultIfMissing('', 5)).toBe(5); | ||
}) | ||
}) | ||
|
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import $ from 'jquery'; | ||
global.$ = global.jQuery = $; |
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
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
Oops, something went wrong.