From 2f93eb103bffe9ca77bf20bc549a0f64b6028c25 Mon Sep 17 00:00:00 2001 From: Walmyr Date: Mon, 15 Jan 2024 19:55:48 +0100 Subject: [PATCH] Adjust list items order And better name list item (TODO ID.) --- cypress/e2e/playground.cy.js | 8 ++++---- src/script.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/playground.cy.js b/cypress/e2e/playground.cy.js index 71b519e..dcdcb66 100644 --- a/cypress/e2e/playground.cy.js +++ b/cypress/e2e/playground.cy.js @@ -81,9 +81,9 @@ describe('Cypress Playground - Test Design Masterclas TAT', () => { cy.get('@todo') .its('response.body.id') .should('be.equal', 1) - cy.contains('#intercept ul li', 'Completed: ').should('be.visible') - cy.contains('#intercept ul li', 'ID: ').should('be.visible') + cy.contains('#intercept ul li', 'TODO ID: ').should('be.visible') cy.contains('#intercept ul li', 'Title: ').should('be.visible') + cy.contains('#intercept ul li', 'Completed: ').should('be.visible') cy.contains('#intercept ul li', 'User ID: ').should('be.visible') }) @@ -100,9 +100,9 @@ describe('Cypress Playground - Test Design Masterclas TAT', () => { .as('todo') .its('response.statusCode') .should('be.equal', 200) - cy.contains('#intercept ul li', `Completed: ${todo.completed}`).should('be.visible') - cy.contains('#intercept ul li', `ID: ${todo.id}`).should('be.visible') + cy.contains('#intercept ul li', `TODO ID: ${todo.id}`).should('be.visible') cy.contains('#intercept ul li', `Title: ${todo.title}`).should('be.visible') + cy.contains('#intercept ul li', `Completed: ${todo.completed}`).should('be.visible') cy.contains('#intercept ul li', `User ID: ${todo.userId}`).should('be.visible') }) }) diff --git a/src/script.js b/src/script.js index f180e8b..ebe0e00 100644 --- a/src/script.js +++ b/src/script.js @@ -89,15 +89,15 @@ document.querySelector('#intercept button').addEventListener('click', async () = const titleListItem = document.createElement('li') const userIdListItem = document.createElement('li') - completedListItem.innerHTML = `Completed: ${completed}` - idListItem.innerHTML = `ID: ${id}` + idListItem.innerHTML = `TODO ID: ${id}` titleListItem.innerHTML = `Title: ${title}` + completedListItem.innerHTML = `Completed: ${completed}` userIdListItem.innerHTML = `User ID: ${userId}` interceptDiv.appendChild(unorderedList) - document.querySelector('#intercept ul').appendChild(completedListItem) document.querySelector('#intercept ul').appendChild(idListItem) document.querySelector('#intercept ul').appendChild(titleListItem) + document.querySelector('#intercept ul').appendChild(completedListItem) document.querySelector('#intercept ul').appendChild(userIdListItem) return {