Skip to content

Commit

Permalink
Merge branch 'master' into 'More-on-this'-should-be-aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
sophieturner0 authored Jul 19, 2024
2 parents eec5bdc + 395f7f2 commit 3df848a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
10 changes: 3 additions & 7 deletions cypress/e2e/admin/signin.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
describe('Admin Login', () => {
it('Admin uses the enable function', () => {
cy.initialSetup('alice', 50)
const username = 'alice'

cy.initialSetup(username, 50)

cy.intercept({
method: 'POST',
Expand All @@ -24,16 +26,10 @@ describe('Admin Login', () => {

// Submit the form
cy.get('#add-node-submit-cta').click()

cy.wait('@updateAbout')

// Close modal and assert the title
cy.get('div[data-testid="close-modal"]').click()
cy.get('.title').should('have.text', title)

cy.contains('About').click({ force: true })
cy.wait(1000)

cy.contains(description).should('be.visible')
})
})
2 changes: 1 addition & 1 deletion cypress/e2e/admin/topics.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('Test topics as Admin', () => {
it('Mute topic', () => {
it.skip('Mute topic', () => {
cy.initialSetup('alice', 300)

cy.get('#cy-open-soure-table').click()
Expand Down
24 changes: 19 additions & 5 deletions cypress/e2e/curationTable/curation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ describe('Test Curation Table', () => {
cy.get('td:nth-child(2)').then(($td) => {
// Access the value of the first td
const tdValue = $td.text()

cy.get('.approve-wrapper button').eq(1).click()
})
})

cy.get('div[data-testid="rename"]').click()

cy.get('#editTopic').should('exist')
Expand All @@ -74,6 +76,7 @@ describe('Test Curation Table', () => {
cy.get('td:nth-child(2)').then(($td) => {
// Access the value of the first td
const tdValue = $td.text().trim()

expect(tdValue).to.equal(newTopic)
})
})
Expand All @@ -98,6 +101,7 @@ describe('Test Curation Table', () => {
const mergeTopic = 'authenticity'
let specificValue = ''
let matchFound = false

cy.initialSetup('alice', 300)

cy.get('#cy-open-soure-table').click()
Expand All @@ -106,17 +110,19 @@ describe('Test Curation Table', () => {

cy.contains('button', 'Topics').click()

//Get node content intercept
// Get node content intercept
cy.wait('@loadTopics')

cy.get('tbody > tr:first').within(() => {
cy.get('td:nth-child(2)').then(($td) => {
// Access the value of the first td
const tdValue = $td.text().trim()

specificValue = tdValue
cy.get('.approve-wrapper button').eq(1).click()
})
})

cy.get('div[data-testid="merge"]').click()

cy.get('#blur-on-select').type(mergeTopic)
Expand Down Expand Up @@ -149,7 +155,7 @@ describe('Test Curation Table', () => {
})
})

it('Mute Topic', () => {
it.skip('Mute Topic', () => {
cy.intercept({
method: 'GET',
url: 'http://localhost:8444/api/nodes/info?skip=0&limit=50&muted=False&sort_by=date&node_type=Topic*',
Expand Down Expand Up @@ -184,6 +190,7 @@ describe('Test Curation Table', () => {
cy.get('td:nth-child(2)').then(($td) => {
// Access the value of the first td
const tdValue = $td.text().trim()

specificValue = tdValue
cy.get('.approve-wrapper button').eq(0).click()
})
Expand Down Expand Up @@ -216,6 +223,7 @@ describe('Test Curation Table', () => {
cy.get('tbody > tr:first').within(() => {
cy.get('td:nth-child(2)').then(($td) => {
const tdValue = $td.text().trim()

secondSpecificValue = tdValue
cy.get('.approve-wrapper button').eq(1).click()
})
Expand Down Expand Up @@ -244,7 +252,7 @@ describe('Test Curation Table', () => {
})
})

it('Unmute Topic', () => {
it.skip('Unmute Topic', () => {
cy.intercept({
method: 'GET',
url: 'http://localhost:8444/api/nodes/info?skip=0&limit=50&muted=False&sort_by=date&node_type=Topic*',
Expand Down Expand Up @@ -281,6 +289,7 @@ describe('Test Curation Table', () => {
cy.get('td:nth-child(2)').then(($td) => {
// Access the value of the first td
const tdValue = $td.text().trim()

specificValue = tdValue
cy.get('.approve-wrapper button').eq(0).click()
})
Expand Down Expand Up @@ -313,6 +322,7 @@ describe('Test Curation Table', () => {
cy.get('tbody > tr:first').within(() => {
cy.get('td:nth-child(2)').then(($td) => {
const tdValue = $td.text().trim()

secondSpecificValue = tdValue
cy.get('.approve-wrapper button').eq(1).click()
})
Expand Down Expand Up @@ -374,9 +384,9 @@ describe('Test Curation Table', () => {

let topicName

let edgeTopicName = 'Racism'
const edgeTopicName = 'Racism'

let edgeType = 'RELATED_TO'
const edgeType = 'RELATED_TO'

cy.get('tbody > tr:first')
.within(() => {
Expand All @@ -402,6 +412,7 @@ describe('Test Curation Table', () => {

for (let i = 0; i < responseData.length; i++) {
const data = responseData[i]

if (data.name === topicName) {
currentTopic = { ...data }
break
Expand All @@ -418,6 +429,7 @@ describe('Test Curation Table', () => {
const responseBody = response.body
let node
let edge

for (let i = 0; i < responseBody.nodes.length; i++) {
if (responseBody.nodes[i].name === edgeTopicName) {
node = { ...responseBody.nodes[i] }
Expand Down Expand Up @@ -463,6 +475,7 @@ describe('Test Curation Table', () => {
cy.get('tbody > tr:first').within(() => {
cy.get('td:nth-child(4)').then(($td) => {
const tdValue = $td.text().trim()

firstCount = parseInt(tdValue)
})
})
Expand All @@ -472,6 +485,7 @@ describe('Test Curation Table', () => {
cy.get('tbody > tr:first').within(() => {
cy.get('td:nth-child(4)').then(($td) => {
const tdValue = parseInt($td.text().trim())

expect(tdValue).to.be.gt(firstCount)
})
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/trendingTopics/trendingTopics.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('test trending topics', () => {
it('Checking it trending topics exist', () => {
it.skip('Checking it trending topics exist', () => {
cy.intercept({
method: 'GET',
url: 'http://localhost:8444/api/prediction/graph/search*',
Expand Down

0 comments on commit 3df848a

Please sign in to comment.