This file contains hidden or 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
| const actionTypes = { | |
| TRANSACTION_SUCCESS: '' | |
| } | |
| export actionTypes; |
This file contains hidden or 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
| //comienza el archivo vacío |
This file contains hidden or 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
| describe('##getItemsGroupedByCategory', ()=> { | |
| it('should receive a callback', ()=> { | |
| assertFnParams(itemModel.getItemsGroupedByCategory, 1); | |
| }); | |
| it('should call the callback with the mongoose response', ()=> { | |
| let callback = function () {}; | |
| mock.schema.aggregate.andReturn(mock.schema); | |
| mock.schema.match.andReturn(mock.schema); |
This file contains hidden or 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
| // Contact Form Scripts | |
| $(function() { | |
| $("#contactForm input,#contactForm textarea").jqBootstrapValidation({ | |
| preventSubmit: true, | |
| submitError: function($form, event, errors) { | |
| // additional error messages or events | |
| }, | |
| submitSuccess: function($form, event) { |
This file contains hidden or 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
| <?php | |
| // Check for empty fields | |
| if(empty($_POST['name']) || | |
| empty($_POST['company']) || | |
| empty($_POST['email']) || | |
| empty($_POST['phone']) || | |
| empty($_POST['country']) || | |
| empty($_POST['message']) || | |
| !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) | |
| { |
This file contains hidden or 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
| require('./API'); | |
| require('./CategoryList'); | |
| const App = { | |
| selector: '#app', | |
| fetchAPI: API, | |
| run(){ | |
| this.fetchAPI | |
| .categories() | |
| .then(this.wrapCategories) //si la función no necesita a this, no hago un bind innecesario |
This file contains hidden or 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
| require('./Container'); | |
| require('./Renderizable'); | |
| const Category = { | |
| name: 'Category', | |
| className: 'category', | |
| tagName: 'article', | |
| toHTML: Renderizable.toHTML, | |
This file contains hidden or 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
| require('./API'); | |
| require('./CategoryList'); | |
| const App = { | |
| selector: '#app', | |
| fetchAPI: API, | |
| run(){ | |
| this.fetchAPI | |
| .categories() | |
| .then(this.addCategoriesToList.bind(this)) // cómo se puede preservar el this dentro de las promises? bluebird soporta un bind() pero parece que ES2015 no :( |
This file contains hidden or 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
| require('./API'); | |
| require('./Item'); | |
| require('./Category'); | |
| const App = { | |
| selector: '#app', | |
| fetchAPI: API, | |
| run(){ | |
| this.fetchAPI | |
| .categories() |
This file contains hidden or 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
| describe('Item', ()=>{ | |
| function setup(){ | |
| const data = { | |
| name: 'test', | |
| image: 'http://placeimg.com/400/300/people/grayscale', | |
| available: true | |
| }; | |
| const anItem = Item.from(data); | |
| return { data, anItem }; | |
| } |