-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1253 from AletheiaFact/create-source-review-workflow
Create source review workflow
- Loading branch information
Showing
98 changed files
with
1,670 additions
and
1,207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* eslint-disable no-undef */ | ||
/// <reference types="cypress" /> | ||
|
||
import locators from "../../support/locators"; | ||
import source from "../../fixtures/source"; | ||
import review from "../../fixtures/review"; | ||
|
||
const goToSourceReviewPage = () => { | ||
cy.visit(`http://localhost:3000/source/${source.data_hash}`); | ||
}; | ||
|
||
describe("Create source and source review", () => { | ||
beforeEach("login", () => cy.login()); | ||
|
||
it("Should create a new Source", () => { | ||
cy.get(locators.floatButton.FLOAT_BUTTON).should("be.visible").click(); | ||
cy.get(locators.floatButton.ADD_SOURCE).should("be.visible").click(); | ||
|
||
cy.url().should("contains", "source"); | ||
cy.get(locators.source.INPUT_SOURCE).type(source.href); | ||
cy.checkRecaptcha(); | ||
cy.get(`${locators.source.BTN_SUBMIT_SOURCE}`).click(); | ||
}); | ||
|
||
it("should not show start source review when not logged in", () => { | ||
goToSourceReviewPage(); | ||
cy.get(locators.claimReview.BTN_START_CLAIM_REVIEW).should("not.exist"); | ||
}); | ||
|
||
it("should be able to assign a user", () => { | ||
goToSourceReviewPage(); | ||
cy.get(locators.claimReview.BTN_START_CLAIM_REVIEW) | ||
.should("exist") | ||
.click(); | ||
cy.get(locators.claimReview.INPUT_USER) | ||
.should("exist") | ||
.type(review.username, { delay: 200 }); | ||
cy.get(".ant-select-item-option-active").click(); | ||
cy.get('[title="reCAPTCHA"]').should("exist"); | ||
cy.get(locators.claimReview.BTN_ASSIGN_USER).should("be.disabled"); | ||
cy.checkRecaptcha(); | ||
cy.get(locators.claimReview.BTN_ASSIGN_USER) | ||
.should("be.enabled") | ||
.click(); | ||
cy.get(locators.claimReview.INPUT_CLASSIFICATION).should("exist"); | ||
}); | ||
|
||
it("should be able to submit source review fields", () => { | ||
goToSourceReviewPage(); | ||
cy.get(locators.claimReview.INPUT_CLASSIFICATION) | ||
.should("exist") | ||
.click(); | ||
cy.get(`[data-cy=${review.classification}]`) | ||
.should("be.visible") | ||
.click(); | ||
|
||
cy.get(locators.claimReview.INPUT_SUMMARY) | ||
.should("exist") | ||
.type(review.summary); | ||
|
||
cy.checkRecaptcha(); | ||
cy.get(locators.claimReview.BTN_FINISH_REPORT) | ||
.should("be.enabled") | ||
.click(); | ||
cy.get(locators.claimReview.BTN_SELECTED_REVIEW).should("exist"); | ||
}); | ||
|
||
it("should not be able submit after choosing assigned user as reviewer", () => { | ||
goToSourceReviewPage(); | ||
cy.checkRecaptcha(); | ||
cy.get(locators.claimReview.BTN_SELECTED_REVIEW) | ||
.should("exist") | ||
.click(); | ||
cy.get(locators.claimReview.INPUT_REVIEWER) | ||
.should("exist") | ||
.type(review.username, { delay: 200 }); | ||
cy.get(".ant-select-item-option-active").click(); | ||
cy.checkRecaptcha(); | ||
cy.get(locators.claimReview.BTN_SUBMIT).should("be.enabled").click(); | ||
cy.get(locators.claimReview.TEXT_REVIEWER_ERROR).should("exist"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const source = { | ||
href: "https://wikipedia.org", | ||
data_hash: "bb2c466041b713fdd03e28917286baa2", | ||
}; | ||
|
||
export default source; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.