-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from harlexkhal/development
Version 1
- Loading branch information
Showing
26 changed files
with
28,647 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"env": { | ||
"test": { | ||
"plugins": ["@babel/plugin-transform-modules-commonjs"] | ||
} | ||
} | ||
} |
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,3 @@ | ||
dist/* | ||
__Testbase__/* | ||
webpack.config.js |
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,25 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"jest": true | ||
}, | ||
"parser": "babel-eslint", | ||
"parserOptions": { | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"extends": ["airbnb-base"], | ||
"rules": { | ||
"no-shadow": "off", | ||
"no-param-reassign": "off", | ||
"eol-last": "off", | ||
"import/extensions": [ 1, { | ||
"js": "always", "json": "always" | ||
}] | ||
}, | ||
"ignorePatterns": [ | ||
"dist/", | ||
"build/" | ||
] | ||
} |
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 @@ | ||
* linguist-vendored | ||
*.js linguist-vendored=false |
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,62 @@ | ||
name: Linters | ||
|
||
on: pull_request | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
lighthouse: | ||
name: Lighthouse | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- name: Setup Lighthouse | ||
run: npm install -g @lhci/cli@0.7.x | ||
- name: Lighthouse Report | ||
run: lhci autorun --upload.target=temporary-public-storage --collect.staticDistDir=. | ||
webhint: | ||
name: Webhint | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- name: Setup Webhint | ||
run: | | ||
npm install --save-dev hint@6.x | ||
[ -f .hintrc ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css-js/.hintrc | ||
- name: Webhint Report | ||
run: npx hint . | ||
stylelint: | ||
name: Stylelint | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- name: Setup Stylelint | ||
run: | | ||
npm install --save-dev stylelint@13.x stylelint-scss@3.x stylelint-config-standard@21.x stylelint-csstree-validator@1.x | ||
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css-js/.stylelintrc.json | ||
- name: Stylelint Report | ||
run: npx stylelint "**/*.{css,scss}" | ||
eslint: | ||
name: ESLint | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
- name: Setup ESLint | ||
run: | | ||
npm install --save-dev eslint@7.x eslint-config-airbnb-base@14.x eslint-plugin-import@2.x babel-eslint@10.x | ||
[ -f .eslintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css-js/.eslintrc.json | ||
- name: ESLint Report | ||
run: npx eslint . |
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,3 @@ | ||
node_modules | ||
dist | ||
.vscode |
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,18 @@ | ||
{ | ||
"connector": { | ||
"name": "local", | ||
"options": { | ||
"pattern": ["**", "!.git/**", "!node_modules/**"] | ||
} | ||
}, | ||
"extends": ["development"], | ||
"formatters": ["stylish"], | ||
"hints": [ | ||
"button-type", | ||
"disown-opener", | ||
"html-checker", | ||
"meta-charset-utf-8", | ||
"meta-viewport", | ||
"no-inline-styles:error" | ||
] | ||
} |
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,10 @@ | ||
{ | ||
"extends": ["stylelint-config-standard"], | ||
"plugins": ["stylelint-scss", "stylelint-csstree-validator"], | ||
"rules": { | ||
"at-rule-no-unknown": null, | ||
"scss/at-rule-no-unknown": true, | ||
"csstree/validator": true | ||
}, | ||
"ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css", "**/*.js", "**/*.jsx"] | ||
} |
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,11 @@ | ||
## Copyright 2021, [Alexander Oguzie-Ibeh, Mnemba Chambuya] | ||
|
||
###### Please delete this line and the next one | ||
|
||
###### APP TYPE can be a webpage/website, a web app, a software and so on | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this [APP TYPE] and associated documentation files, to deal in the [APP TYPE] without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the [APP TYPE], and to permit persons to whom the [APP TYPE] is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the [APP TYPE]. | ||
|
||
THE [APP TYPE] IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE [APP TYPE] OR THE USE OR OTHER DEALINGS IN THE [APP TYPE]. |
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 +1,67 @@ | ||
# JavaScript-Capstone | ||
# JavaScript-Capstone | ||
|
||
![see](./src/assets/images/screenshot.png?raw=true 'Title') | ||
|
||
> The app lists different foods from different areas in the world with opinions from people worldwide. | ||
## Built With | ||
|
||
- JavaScript, HTML, CSS | ||
|
||
## Live Demo | ||
|
||
[Live Demo Link](https://harlexkhal.github.io/Foodipy/) | ||
|
||
## Getting Started | ||
|
||
**This is an example of how you may give instructions on setting up your project locally.** | ||
|
||
### Setup | ||
|
||
1. git clone https://github.com/harlexkhal/Foodipy.git | ||
2. cd Foodipy | ||
3. npm install | ||
4. npm start to serve into local 8080 port | ||
|
||
### Install | ||
|
||
1. git clone https://github.com/harlexkhal/Foodipy.git | ||
2. cd Foodipy | ||
3. npm install | ||
4. npm start to serve into local 8080 port | ||
|
||
### Run tests | ||
|
||
npm run test | ||
|
||
### Deployment | ||
|
||
https://harlexkhal.github.io/Foodipy/ | ||
|
||
## Authors | ||
|
||
👤 **Mnemba Chambuya** | ||
|
||
- GitHub: [@mnekx](https://github.com/mnekx) | ||
- Twitter: [@MnembaChambuya](https://twitter.com/MnembaChambuya) | ||
- LinkedIn: [mnemba-chambuya](https://linkedin.com/in/mnemba-chambuya) | ||
|
||
👤 **Alexander Oguzie-Ibeh** | ||
|
||
- GitHub: [@harlexkhal](https://github.com/harlexkhal) | ||
- Twitter: [@harlexkhal](https://twitter.com/harlexkhal) | ||
- LinkedIn: [alexander-oguzie-ibeh-776814164](https://www.linkedin.com/in/alexander-oguzie-ibeh-776814164/) | ||
|
||
## 🤝 Contributing | ||
|
||
Contributions, issues, and feature requests are welcome! | ||
|
||
Feel free to check the [issues page](../../issues/). | ||
|
||
## Show your support | ||
|
||
Give a ⭐️ if you like this project! | ||
|
||
## 📝 License | ||
|
||
This project is [MIT](./MIT.md) licensed. |
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,101 @@ | ||
import Window from '../custom_modules/application/window'; | ||
|
||
describe('Food Items', () => { | ||
test('Count Items', () => { | ||
document.body.innerHTML = | ||
'<div>' + | ||
' <ul class="meal-content"></ul>' + | ||
'<span class="item-count"></span>' + | ||
'</div>'; | ||
|
||
const itemList = [ | ||
{ | ||
strMeal: "Beef and Mustard Pie", | ||
strMealThumb: "https://www.themealdb.com/images/media/meals/sytuqu1511553755.jpg", | ||
idMeal: "52874" | ||
}, | ||
{ | ||
strMeal: "Beef and Oyster pie", | ||
strMealThumb: "https://www.themealdb.com/images/media/meals/wrssvt1511556563.jpg", | ||
idMeal: "52878" | ||
}, | ||
{ | ||
strMeal: "Beef Banh Mi Bowls with Sriracha Mayo, Carrot & Pickled Cucumber", | ||
strMealThumb: "https://www.themealdb.com/images/media/meals/z0ageb1583189517.jpg", | ||
idMeal: "52997" | ||
}, | ||
{ | ||
strMeal: "Beef Bourguignon", | ||
strMealThumb: "https://www.themealdb.com/images/media/meals/vtqxtu1511784197.jpg", | ||
idMeal: "52904" | ||
}, | ||
{ | ||
strMeal: "Beef Bourguignon", | ||
strMealThumb: "https://www.themealdb.com/images/media/meals/vtqxtu1511784197.jpg", | ||
idMeal: "52904" | ||
} | ||
]; | ||
|
||
const ItemLikesCounter = [ | ||
{ | ||
"likes": 8, | ||
"item_id": "52878" | ||
}, | ||
{ | ||
"likes": 12, | ||
"item_id": "52874" | ||
}, | ||
{ | ||
"likes": 1, | ||
"item_id": "52904" | ||
}, | ||
{ | ||
"likes": 3, | ||
"item_id": "52904" | ||
}, | ||
{ | ||
"likes": 2, | ||
"item_id": "52997" | ||
} | ||
] | ||
const app = new Window(); | ||
app.displayItems(itemList, ItemLikesCounter); | ||
|
||
const list = document.querySelectorAll('.meal-content li'); | ||
expect(list).toHaveLength(5); | ||
}); | ||
}); | ||
|
||
describe('Comments', () => { | ||
test('Count Comments', () => { | ||
document.body.innerHTML = | ||
'<div>' + | ||
' <ul class="user-comments"></ul>' + | ||
'<span class="comment-count-info"></span>' + | ||
'</div>'; | ||
|
||
const comments = [ | ||
{ | ||
"username": "Alexander Ibeh", | ||
"comment": "very yummy", | ||
"creation_date": "2022-03-09" | ||
}, | ||
{ | ||
"username": "Richard", | ||
"creation_date": "2022-03-09", | ||
"comment": "This tastes really good" | ||
}, | ||
{ | ||
"comment": "This tastes really good", | ||
"username": "Richard", | ||
"creation_date": "2022-03-09" | ||
} | ||
]; | ||
|
||
const app = new Window(); | ||
app.displayItemComments(comments); | ||
|
||
const list = document.querySelectorAll('.user-comments li'); | ||
expect(list).toHaveLength(3); | ||
}); | ||
}); |
Oops, something went wrong.