mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2024-12-27 09:29:10 +00:00
fix review details html id consistency,
fix appTestHelpers with proper element selection Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
9bc5b5624b
commit
64d57ffd90
@ -158,7 +158,7 @@ class ReviewCard extends HTMLElement {
|
|||||||
|
|
||||||
//image setup
|
//image setup
|
||||||
let mealImg = document.createElement("img");
|
let mealImg = document.createElement("img");
|
||||||
mealImg.setAttribute("id", "a-mealImg");
|
mealImg.setAttribute("id", "a-meal-img");
|
||||||
mealImg.setAttribute("alt","Meal Photo Corrupted");
|
mealImg.setAttribute("alt","Meal Photo Corrupted");
|
||||||
mealImg.setAttribute("src",data["mealImg"]);
|
mealImg.setAttribute("src",data["mealImg"]);
|
||||||
mealImg.addEventListener("error", function(e) {
|
mealImg.addEventListener("error", function(e) {
|
||||||
@ -170,7 +170,7 @@ class ReviewCard extends HTMLElement {
|
|||||||
let meallabelDiv = document.createElement("div");
|
let meallabelDiv = document.createElement("div");
|
||||||
meallabelDiv.setAttribute("class", "meal-name-div");
|
meallabelDiv.setAttribute("class", "meal-name-div");
|
||||||
let mealLabel = document.createElement("label");
|
let mealLabel = document.createElement("label");
|
||||||
mealLabel.setAttribute("id", "a-mealName");
|
mealLabel.setAttribute("id", "a-meal-name");
|
||||||
mealLabel.setAttribute("class","meal-name");
|
mealLabel.setAttribute("class","meal-name");
|
||||||
mealLabel.innerHTML = data["mealName"];
|
mealLabel.innerHTML = data["mealName"];
|
||||||
meallabelDiv.append(mealLabel);
|
meallabelDiv.append(mealLabel);
|
||||||
@ -252,7 +252,7 @@ class ReviewCard extends HTMLElement {
|
|||||||
dataContainer["reviewID"] = this.reviewID;
|
dataContainer["reviewID"] = this.reviewID;
|
||||||
|
|
||||||
//get image
|
//get image
|
||||||
let mealImg = this.shadowEl.getElementById("a-mealImg");
|
let mealImg = this.shadowEl.getElementById("a-meal-img");
|
||||||
dataContainer["mealImg"] = mealImg.getAttribute("src");
|
dataContainer["mealImg"] = mealImg.getAttribute("src");
|
||||||
|
|
||||||
//get meal name
|
//get meal name
|
||||||
|
@ -40,13 +40,13 @@ export async function setReviewForm(page, review) {
|
|||||||
*/
|
*/
|
||||||
export async function checkCorrectness(root, prefix, expected){
|
export async function checkCorrectness(root, prefix, expected){
|
||||||
// Get the review image and check src
|
// Get the review image and check src
|
||||||
let img = await root.$(`#${prefix}-mealImg`);
|
let img = await root.$(`#${prefix}-meal-img`);
|
||||||
let imgSrc = await img.getProperty("src");
|
let imgSrc = await img.getProperty("src");
|
||||||
// Check src
|
// Check src
|
||||||
assert.strictEqual(await imgSrc.jsonValue(), expected.imgSrc);
|
assert.strictEqual(await imgSrc.jsonValue(), expected.imgSrc);
|
||||||
|
|
||||||
// Get the title, comment, and restaurant
|
// Get the title, comment, and restaurant
|
||||||
let title = await root.$(`#${prefix}-mealName`);
|
let title = await root.$(`#${prefix}-meal-name`);
|
||||||
let title_text = await title.getProperty("innerText");
|
let title_text = await title.getProperty("innerText");
|
||||||
let comment = await root.$(`#${prefix}-comments`);
|
let comment = await root.$(`#${prefix}-comments`);
|
||||||
let comment_text = await comment.getProperty("innerText");
|
let comment_text = await comment.getProperty("innerText");
|
||||||
|
Loading…
Reference in New Issue
Block a user