mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2025-09-09 08:07:22 +00:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
35f44049a2 | ||
|
4eaa1f38bb | ||
|
004e5cc2a2 | ||
|
f9074a2bc6 | ||
|
cf551f932b | ||
|
85dc0544c7 | ||
|
29b065562e | ||
|
0ebf9f8a20 | ||
|
d9c28096fd | ||
|
7abc995ffe | ||
|
cbe8da609c | ||
|
dd7d876f29 | ||
|
540d6563d8 | ||
|
d9297d7c64 | ||
|
2ce3714f8d | ||
|
09dd837081 |
2
.github/workflows/js-unittest.yml
vendored
2
.github/workflows/js-unittest.yml
vendored
@@ -23,5 +23,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
- name: Install dependencies
|
||||
run: sudo npm install
|
||||
- name: Start local http server
|
||||
run: sudo npm run http-server
|
||||
- name: Run tests
|
||||
run: sudo npm test
|
Binary file not shown.
@@ -55,6 +55,14 @@ Overall we feel that sprint 1 was a success with many lessons learned. Our enthu
|
||||
* Scheduled meetings with more notice and keep meetings at a more central location so that more members can attend
|
||||
* Get the unit testing modules up to date
|
||||
* To-do: create a style guide
|
||||
* Heed the styles and documentation (to avoid linter issues)
|
||||
|
||||
## Early Issues
|
||||
* restructure local storage to store individual (key, review) pairs rather than storing data under one key (current schema)
|
||||
* implement a file upload system (think canvas file upload)
|
||||
* add a cuisine attribute for tagging and filtering
|
||||
* Create UI buttons and low fidelity css
|
||||
* Unit test all the above
|
||||
|
||||
## End Time
|
||||
- 11/14/2022 at 5:00PM
|
@@ -7,7 +7,8 @@
|
||||
"lint": "eslint '**/*.js'",
|
||||
"fix-style": "eslint --fix **/*.js",
|
||||
"lintHTML": "htmlhint '**/*.html'",
|
||||
"lintCSS": "stylelint '**/*.css'"
|
||||
"lintCSS": "stylelint '**/*.css'",
|
||||
"http-server": "http-server source"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.27.0",
|
||||
@@ -15,6 +16,8 @@
|
||||
"mocha": "10",
|
||||
"mock-local-storage": "^1.1.23",
|
||||
"stylelint": "14.14.1",
|
||||
"stylelint-config-standard": "^29.0.0"
|
||||
"stylelint-config-standard": "^29.0.0",
|
||||
"puppeteer": "18",
|
||||
"http-server": ""
|
||||
}
|
||||
}
|
||||
|
@@ -14,12 +14,13 @@
|
||||
<!-- Main Stylesheets & Scripts -->
|
||||
<!-- Temporarily commented out reset.css due to furthur discussion needed on the values of the default config-->
|
||||
<!-- <link rel="stylesheet" href="/static/reset.css" /> -->
|
||||
<link rel="stylesheet" href="./static/CreatePage.css" />
|
||||
<script src="assets/scripts/main.js" type="module"></script>
|
||||
<link rel="stylesheet" href="./static/ReviewCard.css" />
|
||||
<script src="./assets/scripts/CreatePage.js" type="module"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<input type="button" value="Home" id="home-btn" onclick="window.location.assign('./index.html')">
|
||||
<form id="new-food-entry">
|
||||
<fieldset>
|
||||
<legend>Pic:</legend>
|
||||
@@ -69,8 +70,7 @@
|
||||
</label>
|
||||
|
||||
</fieldset>
|
||||
<button type="submit" value="Submit">Add Review</button>
|
||||
<button type="button" class="danger">Clear Review Journal</button>
|
||||
<button type="submit" id="save-btn" value="Submit">Save Review</button>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
|
@@ -19,8 +19,9 @@
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<button type="button" id="update">Update</button>
|
||||
<button type="button" id="delete" class="danger">Delete</button>
|
||||
<input type="button" value="Home" id="home-btn" onclick="window.location.assign('./index.html')">
|
||||
<button type="button" id="update-btn">Update</button>
|
||||
<button type="button" id="delete-btn" class="danger">Delete</button>
|
||||
</main>
|
||||
<!----> <form id="update-food-entry" class="hidden">
|
||||
<fieldset>
|
||||
@@ -67,7 +68,7 @@
|
||||
<div class='tag-container' id="tag-container-form">
|
||||
|
||||
</div>
|
||||
<button type="button" id="tagAdd">Add Tag</button>
|
||||
<button type="button" id="tag-add-btn">Add Tag</button>
|
||||
</label>
|
||||
|
||||
</fieldset>
|
||||
|
78
source/assets/scripts/CreatePage.js
Normal file
78
source/assets/scripts/CreatePage.js
Normal file
@@ -0,0 +1,78 @@
|
||||
window.addEventListener("DOMContentLoaded", init);
|
||||
|
||||
function init() {
|
||||
// get next id
|
||||
|
||||
// creates the key
|
||||
initFormHandler();
|
||||
|
||||
}
|
||||
|
||||
function initFormHandler() {
|
||||
|
||||
//accessing form components
|
||||
let tagContainer = document.getElementById("tag-container-form");
|
||||
let form = document.querySelector("form");
|
||||
|
||||
form.addEventListener("submit", function(e){
|
||||
/*
|
||||
* User submits the form for their review.
|
||||
* We create reviewCard and put in storage
|
||||
*/
|
||||
e.preventDefault();
|
||||
let formData = new FormData(form);
|
||||
let reviewObject = {};
|
||||
for (let [key, value] of formData) {
|
||||
console.log(`${key}`);
|
||||
console.log(`${value}`);
|
||||
if (`${key}` !== "tag-form") {
|
||||
reviewObject[`${key}`] = `${value}`;
|
||||
}
|
||||
}
|
||||
reviewObject["tags"] = [];
|
||||
|
||||
let tags = document.querySelectorAll(".tag");
|
||||
for(let i = 0; i < tags.length; i ++) {
|
||||
reviewObject["tags"].push(tags[i].innerHTML);
|
||||
tagContainer.removeChild(tags[i]);
|
||||
}
|
||||
|
||||
//grabbing the nextID, and putting our review object in storage associated with the ID
|
||||
let nextReviewId = JSON.parse(localStorage.getItem("nextID"));
|
||||
reviewObject["reviewID"] = nextReviewId;
|
||||
|
||||
localStorage.setItem("review"+nextReviewId, JSON.stringify(reviewObject));
|
||||
sessionStorage.setItem("currID", JSON.stringify(nextReviewId));
|
||||
|
||||
//updating our activeIDS list
|
||||
let tempIdArr = JSON.parse(localStorage.getItem("activeIDS"));
|
||||
tempIdArr.push(nextReviewId);
|
||||
localStorage.setItem("activeIDS", JSON.stringify(tempIdArr));
|
||||
|
||||
|
||||
//increment nextID for next review creation
|
||||
nextReviewId++;
|
||||
localStorage.setItem("nextID", JSON.stringify(nextReviewId));
|
||||
|
||||
window.location.assign('./ReviewDetails.html');
|
||||
|
||||
});
|
||||
|
||||
let tagAddBtn = document.getElementById("tagAdd");
|
||||
tagAddBtn.addEventListener("click", ()=> {
|
||||
let tagField = document.getElementById("tag-form");
|
||||
if (tagField.value.length > 0) {
|
||||
let tagLabel = document.createElement("label");
|
||||
tagLabel.innerHTML = tagField.value;
|
||||
tagLabel.setAttribute("class","tag");
|
||||
tagLabel.addEventListener("click",()=> {
|
||||
tagContainer.removeChild(tagLabel);
|
||||
});
|
||||
|
||||
tagContainer.append(tagLabel);
|
||||
tagField.value = "";
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
@@ -6,7 +6,6 @@ class ReviewCard extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
||||
let shadowEl = this.attachShadow({mode:"open"});
|
||||
|
||||
let articleEl = document.createElement("article");
|
||||
@@ -88,9 +87,9 @@ class ReviewCard extends HTMLElement {
|
||||
//attach event listener to each recipe-card
|
||||
this.addEventListener("click", (event) => {
|
||||
console.log(event.target);
|
||||
console.log(event.target.data);
|
||||
console.log(event.target.reviewId);
|
||||
//Option 1: sending current data to second html page using localStorage (could also just store index)
|
||||
sessionStorage.setItem("current", JSON.stringify(event.target.data));
|
||||
sessionStorage.setItem("currID", JSON.stringify(event.target.data.reviewID));
|
||||
window.location.assign("./ReviewDetails.html");
|
||||
/*
|
||||
//Option 2: sending current data to second html page using string query w/ url (currently not storing value)
|
||||
@@ -133,12 +132,18 @@ class ReviewCard extends HTMLElement {
|
||||
let articleEl = this.shadowEl.querySelector("article");
|
||||
|
||||
// setting the article elements for the review card
|
||||
this.reviewID = data["reviewID"];
|
||||
|
||||
//image setup
|
||||
let mealImg = document.createElement("img");
|
||||
mealImg.setAttribute("id", "a-mealImg");
|
||||
mealImg.setAttribute("src",data["mealImg"]);
|
||||
mealImg.setAttribute("alt",data["imgAlt"]);
|
||||
if(data["mealImg"] != ""){
|
||||
mealImg.setAttribute("src",data["mealImg"]);
|
||||
}
|
||||
else{
|
||||
mealImg.setAttribute("src", "./assets/images/icons/plate_with_cutlery.png");
|
||||
}
|
||||
|
||||
//meal name setup
|
||||
let mealLabel = document.createElement("label");
|
||||
@@ -147,26 +152,6 @@ class ReviewCard extends HTMLElement {
|
||||
mealLabel.innerHTML = data["mealName"];
|
||||
|
||||
//restaurant name setup
|
||||
/*
|
||||
//review page link
|
||||
//giving it functionality to save the review card's info to session storage for loading the review page
|
||||
let reviewLink = document.createElement('a');
|
||||
reviewLink.setAttribute('href','./review.html')
|
||||
reviewLink.innerHTML = 'review page'
|
||||
reviewLink.addEventListener('click', () => {
|
||||
sessionStorage.clear();
|
||||
let currReview = {
|
||||
"imgSrc": data['imgSrc'],
|
||||
"imgAlt": data['imgAlt'],
|
||||
"mealName": data['mealName'],
|
||||
"restaurant": data['restaurant'],
|
||||
"comments": data['comments'],
|
||||
"rating": data['rating'],
|
||||
"tags": data['tags']
|
||||
}
|
||||
sessionStorage.setItem('currReview', JSON.stringify(currReview));
|
||||
});
|
||||
*/
|
||||
let restaurantLabel = document.createElement("label");
|
||||
restaurantLabel.setAttribute("id", "a-restaurant");
|
||||
restaurantLabel.setAttribute("class","restaurant-name");
|
||||
@@ -197,14 +182,15 @@ class ReviewCard extends HTMLElement {
|
||||
for (let i = 0; i < data["tags"].length; i++) {
|
||||
let newTag = document.createElement("label");
|
||||
newTag.setAttribute("class","tag");
|
||||
newTag.innerHTML = data["tags"][i] + " ";
|
||||
newTag.innerHTML = data["tags"][i];
|
||||
tagContainer.append(newTag);
|
||||
}
|
||||
}
|
||||
|
||||
//adding final ID to data!
|
||||
|
||||
articleEl.append(mealImg);
|
||||
articleEl.append(mealLabel);
|
||||
//articleEl.append(reviewLink)
|
||||
articleEl.append(restaurantLabel);
|
||||
articleEl.append(ratingDiv);
|
||||
articleEl.append(tagContainer);
|
||||
@@ -237,6 +223,7 @@ class ReviewCard extends HTMLElement {
|
||||
let dataContainer = {};
|
||||
|
||||
// getting the article elements for the review card
|
||||
dataContainer["reviewID"] = this.reviewID;
|
||||
|
||||
//get image
|
||||
let mealImg = this.shadowEl.getElementById("a-mealImg");
|
||||
|
@@ -10,24 +10,19 @@ function init(){
|
||||
}
|
||||
|
||||
function setupDelete(){
|
||||
let deleteBtn = document.getElementById("delete");
|
||||
let reviews = getReviewsFromStorage();
|
||||
let current = JSON.parse(sessionStorage.getItem("current"));
|
||||
let deleteBtn = document.getElementById("delete-btn");
|
||||
let currID = JSON.parse(sessionStorage.getItem("currID"));
|
||||
let activeIDS = JSON.parse(localStorage.getItem("activeIDS"));
|
||||
deleteBtn.addEventListener("click", function(){
|
||||
if(window.confirm("Are you sure you want to delete this entry?")){
|
||||
//delete function
|
||||
if(current){
|
||||
console.log(current);
|
||||
for(let i = 0; i < reviews.length; i++){
|
||||
console.log(reviews[i]);
|
||||
if(reviews[i]["mealName"] == current["mealName"] && reviews[i]["restaurant"] == current["restaurant"]){
|
||||
console.log("match found");
|
||||
reviews.splice(i,1);
|
||||
saveReviewsToStorage(reviews);
|
||||
sessionStorage.removeItem("current");
|
||||
window.location.assign("./index.html");
|
||||
break;
|
||||
}
|
||||
for (let i in activeIDS) {
|
||||
if (activeIDS[i] == currID) {
|
||||
activeIDS.splice(i,1);
|
||||
localStorage.setItem('activeIDS', JSON.stringify(activeIDS));
|
||||
sessionStorage.removeItem('currID');
|
||||
localStorage.removeItem(`review${currID}`);
|
||||
window.location.assign("./index.html");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,31 +30,32 @@ function setupDelete(){
|
||||
}
|
||||
|
||||
function setupUpdate(){
|
||||
let updateBtn = document.getElementById("update");
|
||||
let reviews = getReviewsFromStorage();
|
||||
let current = JSON.parse(sessionStorage.getItem("current"));
|
||||
let updateBtn = document.getElementById("update-btn");
|
||||
let currID = JSON.parse(sessionStorage.getItem("currID"));
|
||||
let currReview = JSON.parse(localStorage.getItem(`review${currID}`));
|
||||
let form = document.getElementById("update-food-entry");
|
||||
updateBtn.addEventListener("click", function(){
|
||||
//update function
|
||||
if(current){
|
||||
console.log(current);
|
||||
if(currReview){
|
||||
form.style.display = "block";
|
||||
let tagContainer = document.getElementById("tag-container-form");
|
||||
console.log(document.querySelectorAll("#update-food-entry input"));
|
||||
|
||||
//Set value of each input element to current's values
|
||||
document.getElementById("mealImg").defaultValue = current["mealImg"];
|
||||
document.getElementById("imgAlt").defaultValue = current["imgAlt"];
|
||||
document.getElementById("mealName").defaultValue = current["mealName"];
|
||||
document.getElementById("comments").textContent = current["comments"];
|
||||
document.getElementById("rating-" + `${current["rating"]}`).checked = true;
|
||||
document.getElementById("restaurant").defaultValue = current["restaurant"];
|
||||
document.getElementById("mealImg").defaultValue = currReview["mealImg"];
|
||||
document.getElementById("imgAlt").defaultValue = currReview["imgAlt"];
|
||||
document.getElementById("mealName").defaultValue = currReview["mealName"];
|
||||
document.getElementById("comments").textContent = currReview["comments"];
|
||||
document.getElementById("s" + `${currReview["rating"]}`).checked = true;
|
||||
document.getElementById("restaurant").defaultValue = currReview["restaurant"];
|
||||
|
||||
if(current["tags"]){
|
||||
for (let i = 0; i < current["tags"].length; i++) {
|
||||
if(currReview["tags"]){
|
||||
while (tagContainer.firstChild) {
|
||||
tagContainer.removeChild(tagContainer.firstChild);
|
||||
}
|
||||
for (let i = 0; i < currReview["tags"].length; i++) {
|
||||
let newTag = document.createElement("label");
|
||||
newTag.setAttribute("class","tag");
|
||||
newTag.innerHTML = current["tags"][i] + " ";
|
||||
newTag.innerHTML = currReview["tags"][i];
|
||||
newTag.addEventListener("click",()=> {
|
||||
tagContainer.removeChild(newTag);
|
||||
});
|
||||
@@ -89,22 +85,16 @@ function setupUpdate(){
|
||||
tagContainer.removeChild(tags[i]);
|
||||
}
|
||||
|
||||
for(let i = 0; i < reviews.length; i++){
|
||||
console.log(reviews[i]);
|
||||
if(reviews[i]["mealName"] == current["mealName"] && reviews[i]["restaurant"] == current["restaurant"]){
|
||||
console.log("match found");
|
||||
reviews.splice(i,1,newData);
|
||||
saveReviewsToStorage(reviews);
|
||||
sessionStorage.setItem("current", JSON.stringify(newData));
|
||||
break;
|
||||
}
|
||||
}
|
||||
newData["reviewID"] = currID;
|
||||
|
||||
|
||||
localStorage.setItem("review"+currID, JSON.stringify(newData));
|
||||
|
||||
form.style.display = "none";
|
||||
|
||||
});
|
||||
|
||||
let tagAddBtn = document.getElementById("tagAdd");
|
||||
let tagAddBtn = document.getElementById("tag-add-btn");
|
||||
tagAddBtn.addEventListener("click", ()=> {
|
||||
let tagField = document.getElementById("tag-form");
|
||||
if (tagField.value.length > 0) {
|
||||
|
@@ -2,11 +2,19 @@
|
||||
* @returns {Array<Object>} An array of reviews found in localStorage
|
||||
*/
|
||||
export function getReviewsFromStorage() {
|
||||
let result = JSON.parse(localStorage.getItem("reviews"));
|
||||
if (result) {
|
||||
return result;
|
||||
if (!(localStorage.getItem("activeIDS"))) {
|
||||
// we wanna init the active ID array and start the nextID count
|
||||
localStorage.setItem("activeIDS", JSON.stringify([]));
|
||||
localStorage.setItem("nextID", JSON.stringify(0));
|
||||
}
|
||||
return new Array(0);
|
||||
//iterate thru activeIDS
|
||||
let activeIDS = JSON.parse(localStorage.getItem("activeIDS"));
|
||||
let reviews = []
|
||||
for (let i = 0; i < activeIDS.length; i++) {
|
||||
let currReview = JSON.parse(localStorage.getItem('review'+activeIDS[i]));
|
||||
reviews.push(currReview);
|
||||
}
|
||||
return reviews;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -15,5 +23,5 @@ export function getReviewsFromStorage() {
|
||||
* @param {Array<Object>} reviews An array of reviews
|
||||
*/
|
||||
export function saveReviewsToStorage(reviews) {
|
||||
localStorage.setItem("reviews", JSON.stringify(reviews));
|
||||
localStorage.setItem(`review${reviewId}`, JSON.stringify(reviews));
|
||||
}
|
||||
|
@@ -2,11 +2,12 @@ import {strict as assert} from "node:assert";
|
||||
import {describe, it, beforeEach} from "mocha";
|
||||
import {saveReviewsToStorage, getReviewsFromStorage} from "./localStorage.js";
|
||||
|
||||
beforeEach(() => {
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
describe("test app localStorage interaction", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
it("get after init", () => {
|
||||
assert.deepEqual(getReviewsFromStorage(), []);
|
||||
});
|
||||
|
31
source/assets/scripts/main.e2e.test.js
Normal file
31
source/assets/scripts/main.e2e.test.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import {strict as assert} from "node:assert";
|
||||
import {describe, it, beforeEach, afterEach} from "mocha";
|
||||
import puppeteer from "puppeteer-core";
|
||||
import { exit } from "node:process";
|
||||
|
||||
describe("test App end to end", async () => {
|
||||
|
||||
let browser;
|
||||
let page;
|
||||
|
||||
beforeEach(async () => {
|
||||
browser = await puppeteer.launch();
|
||||
page = await browser.newPage();
|
||||
try{
|
||||
await page.goto("http://localhost:8080", {timeout: 1000});
|
||||
}
|
||||
catch (error) {
|
||||
console.log("❌ failed to connect to localhost webserver on port 8080");
|
||||
exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
it("page should have correct title", async () => {
|
||||
assert.strictEqual(await page.title(), "Food Journal");
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await page.close();
|
||||
await browser.close();
|
||||
});
|
||||
});
|
@@ -13,6 +13,7 @@ function init() {
|
||||
initFormHandler();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array<Object>} reviews An array of reviews
|
||||
*/
|
||||
@@ -33,14 +34,14 @@ function addReviewsToDocument(reviews) {
|
||||
*/
|
||||
function initFormHandler() {
|
||||
|
||||
/*
|
||||
//btn to create form (could be its own function?)
|
||||
let createBtn = document.getElementById("create");
|
||||
let createBtn = document.getElementById("create-btn");
|
||||
createBtn.addEventListener("click", function(){
|
||||
window.location.assign("./CreatePage.html");
|
||||
});*/
|
||||
|
||||
});
|
||||
|
||||
//accessing form components
|
||||
/*
|
||||
let tagContainer = document.getElementById("tag-container-form");
|
||||
let form = document.querySelector("form");
|
||||
|
||||
@@ -48,7 +49,6 @@ function initFormHandler() {
|
||||
/*
|
||||
* User submits the form for their review.
|
||||
* We create reviewCard and put in storage
|
||||
*/
|
||||
let formData = new FormData(form);
|
||||
let reviewObject = {};
|
||||
for (let [key, value] of formData) {
|
||||
@@ -74,6 +74,9 @@ function initFormHandler() {
|
||||
let mainEl = document.querySelector("main");
|
||||
mainEl.append(newReview);
|
||||
|
||||
// TODO: assign an ID to be used for referencing this object form the activeIDs array and the tag arrays
|
||||
let ID = localStorage.nextID;
|
||||
|
||||
let storedReviews = getReviewsFromStorage();
|
||||
storedReviews.push(reviewObject);
|
||||
saveReviewsToStorage(storedReviews);
|
||||
@@ -115,5 +118,6 @@ function initFormHandler() {
|
||||
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
}
|
||||
|
@@ -22,8 +22,8 @@
|
||||
<main>
|
||||
<!-- Add Food Entries Here -->
|
||||
</main>
|
||||
<!--<button type="button" id="create">CREATE</button>-->
|
||||
<!----> <form id="new-food-entry">
|
||||
<button type="button" id="create-btn"><a href='./CreatePage.html'></a>CREATE</button>
|
||||
<!-- <form id="new-food-entry">
|
||||
<fieldset>
|
||||
<legend>Pic:</legend>
|
||||
<label for="mealImage">
|
||||
@@ -74,6 +74,6 @@
|
||||
</fieldset>
|
||||
<button type="submit" value="Submit">Add Review</button>
|
||||
<button type="button" class="danger">Clear Review Journal</button>
|
||||
</form> <!---->
|
||||
</form> -->
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -81,3 +81,50 @@ main {
|
||||
background-color: rgb(254 171 171);
|
||||
border-color: red;
|
||||
}
|
||||
|
||||
.hidden,
|
||||
.rating:not(:checked) > input { /* Hide radio circles while star rating */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Unchecked stars */
|
||||
.rating:not(:checked) > label {
|
||||
/* Make stars line up sideways and not vertically */
|
||||
float: right;
|
||||
|
||||
/* Hide label text */
|
||||
width: 1em;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
||||
/* Star default color and size */
|
||||
font-size: 200%;
|
||||
line-height: 1.2;
|
||||
color: #b3b3cc;
|
||||
}
|
||||
|
||||
.rating > label:active {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.rating:not(:checked) > label::before {
|
||||
content: "★";
|
||||
}
|
||||
|
||||
/* Checked star color */
|
||||
.rating > input:checked ~ label {
|
||||
color: #ffbf00;
|
||||
}
|
||||
|
||||
.rating:not(:checked) > label:hover,
|
||||
.rating:not(:checked) > label:hover ~ label {
|
||||
color: orangered;
|
||||
}
|
||||
|
||||
.rating > input:checked + label:hover,
|
||||
.rating > input:checked ~ label:hover,
|
||||
.rating > input:checked + label:hover ~ label,
|
||||
.rating > input:checked ~ label:hover ~ label,
|
||||
.rating > label:hover ~ input:checked ~ label {
|
||||
color: orangered;
|
||||
}
|
||||
|
19
specs/adrs/111622-e2etesting-puppeteer.md
Normal file
19
specs/adrs/111622-e2etesting-puppeteer.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Use puppeteer for JS unit testing framework
|
||||
|
||||
- Status: accept
|
||||
- Deciders: Arthur Lu, Marc Reta
|
||||
- Date: 11 / 16 / 22
|
||||
|
||||
## Decision Drivers
|
||||
|
||||
- Need end to end testing framework which runs headlessly and quickly
|
||||
- Framework should integrate well with Mocha, the existing unit testing framework
|
||||
- Framework should be easy to implement end to end tests with
|
||||
|
||||
## Considered Options
|
||||
- puppeteer
|
||||
- selenium-webdriver
|
||||
|
||||
## Decision Outcome
|
||||
|
||||
Chosen Option: Puppeteer for its ease of use with mocha.
|
Reference in New Issue
Block a user