mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2024-12-27 09:29:10 +00:00
fixes to tag-add-btn,
fixes to tests with rating selection Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
1379c22f6f
commit
7035fa46ee
@ -47,11 +47,11 @@
|
||||
|
||||
<fieldset class="rating">
|
||||
<legend> Rating: </legend>
|
||||
<input type="radio" id="s5" name="rating" value="5"/> <label for="s5"> 5 stars </label>
|
||||
<input type="radio" id="s4" name="rating" value="4"/> <label for="s4"> 4 stars </label>
|
||||
<input type="radio" id="s3" name="rating" value="3"/> <label for="s3"> 3 stars </label>
|
||||
<input type="radio" id="s2" name="rating" value="2"/> <label for="s2"> 2 stars </label>
|
||||
<input type="radio" id="s1" name="rating" value="1"/> <label for="s1"> 1 star </label>
|
||||
<input type="radio" id="s5" name="rating" value="5"/> <label for="s5" id="s5-select"> 5 stars </label>
|
||||
<input type="radio" id="s4" name="rating" value="4"/> <label for="s4" id="s4-select"> 4 stars </label>
|
||||
<input type="radio" id="s3" name="rating" value="3"/> <label for="s3" id="s3-select"> 3 stars </label>
|
||||
<input type="radio" id="s2" name="rating" value="2"/> <label for="s2" id="s2-select"> 2 stars </label>
|
||||
<input type="radio" id="s1" name="rating" value="1"/> <label for="s1" id="s1-select"> 1 star </label>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
@ -66,7 +66,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>
|
||||
|
@ -49,11 +49,11 @@
|
||||
|
||||
<fieldset class="rating">
|
||||
<legend> Rating: </legend>
|
||||
<input type="radio" id="s5" name="rating" value="5"/> <label for="s5"> 5 stars </label>
|
||||
<input type="radio" id="s4" name="rating" value="4"/> <label for="s4"> 4 stars </label>
|
||||
<input type="radio" id="s3" name="rating" value="3"/> <label for="s3"> 3 stars </label>
|
||||
<input type="radio" id="s2" name="rating" value="2"/> <label for="s2"> 2 stars </label>
|
||||
<input type="radio" id="s1" name="rating" value="1"/> <label for="s1"> 1 star </label>
|
||||
<input type="radio" id="s5" name="rating" value="5"/> <label for="s5" id="s5-select"> 5 stars </label>
|
||||
<input type="radio" id="s4" name="rating" value="4"/> <label for="s4" id="s4-select"> 4 stars </label>
|
||||
<input type="radio" id="s3" name="rating" value="3"/> <label for="s3" id="s3-select"> 3 stars </label>
|
||||
<input type="radio" id="s2" name="rating" value="2"/> <label for="s2" id="s2-select"> 2 stars </label>
|
||||
<input type="radio" id="s1" name="rating" value="1"/> <label for="s1" id="s1-select"> 1 star </label>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
|
@ -46,7 +46,7 @@ function initFormHandler() {
|
||||
|
||||
});
|
||||
|
||||
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) {
|
||||
|
@ -55,14 +55,14 @@ describe("test App end to end", async () => {
|
||||
await page.$eval("#tag-form", (el, value) => el.value = `tag ${value}`, i);
|
||||
await tag_btn.click();
|
||||
}
|
||||
|
||||
|
||||
// Select a new rating of 1 star
|
||||
let rating_select = await page.$("#s1");
|
||||
rating_select.click();
|
||||
let rating_select = await page.$("#s1-select");
|
||||
await rating_select.click({delay: 100});
|
||||
|
||||
// Click the save button to save updates
|
||||
let save_btn = await page.$("#save-btn");
|
||||
save_btn.click();
|
||||
await save_btn.click();
|
||||
await page.waitForNavigation();
|
||||
});
|
||||
|
||||
@ -260,7 +260,7 @@ describe("test App end to end", async () => {
|
||||
// Get all tag elements and click them to delete them
|
||||
let tag_items = await page.$$(".tag");
|
||||
for(let i = 0; i < tag_items.length; i++){
|
||||
await tag_items.click();
|
||||
await tag_items[i].click();
|
||||
}
|
||||
|
||||
// Get the button needed to add new tags
|
||||
@ -271,12 +271,12 @@ describe("test App end to end", async () => {
|
||||
}
|
||||
|
||||
// Select a new rating of 5 stars
|
||||
let rating_select = await page.$("#s5");
|
||||
rating_select.click();
|
||||
let rating_select = await page.$("#s5-select");
|
||||
await rating_selects.click();
|
||||
|
||||
// Click the save button to save updates
|
||||
let save_btn = await page.$("#save-btn");
|
||||
save_btn.click();
|
||||
await save_btn.click();
|
||||
await page.waitForNavigation();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user