Skip to content

Commit

Permalink
Merge pull request #1150 from necyberteam/md-dev
Browse files Browse the repository at this point in the history
Md dev
  • Loading branch information
a-pasquale authored Apr 23, 2024
2 parents 8ae2511 + 0bb3c10 commit 5b6ff9f
Show file tree
Hide file tree
Showing 22 changed files with 1,026 additions and 30 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ jobs:
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"
ccmnet:
name: Run cypress tests in 'ccmnet' directory
uses: necyberteam/reusable_actions/.github/workflows/cypress.yml@v3
if: contains(github.event.inputs.sites, 'ccmnet') || github.event_name == 'pull_request'
secrets:
slack_token: ${{ secrets.SLACK_TOKEN }}
site: "ccmnet"
database: ${{ github.event.inputs.database }}
prnum: ${{ github.event.inputs.prnum }}
gh_token: ${{ secrets.GH_TOKEN_REPO }}
LANDO_ENV: ${{ secrets.LANDO_ENV }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
REPO: "${{ github.server_url }}/${{ github.repository }}"

# success:
# name: Actions to run on success
Expand All @@ -56,7 +69,7 @@ jobs:

fail:
name: Actions to run on fail
needs: [asp]
needs: [asp, ccmnet]
if: ${{ failure() }}
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions blt/md/md-2059
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ccmnet_org
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions tests/cypress/cypress/e2e/ccmnet/home.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
CCMnet Homepage for an unauthenticated user.
*/
describe("Unauthenticated user tests the CCMNet Homepage", () => {
it("Should test the CCMNet Homepage for unauthenticated user", () => {
cy.visit("/");

// Site heading
cy.get(".site-heading").contains(
"A peer-to-peer program for CI professionals to make connections and exchange knowledge"
);

});
});

36 changes: 36 additions & 0 deletions tests/cypress/cypress/e2e/ccmnet/mentorships/add-mentorship.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Authenticated user creates a new Mentorship Engagement.
*/
describe("Authenticated user creates a Mentorship Engagement", () => {
it("Authenticated user creates a Mentorship Engagement", () => {
cy.loginWith("[email protected]", "Pecan")
cy.visit("/node/add/mentorship_engagement")

// check the box for "I am looking for a mentor"
cy.get("#edit-field-me-looking-for-mentor").check()

cy.get("#edit-title-0-value").type("Mentorship Title")

cy.get("#edit-body-0-summary").type("Mentorship Summary")

cy.get('.form-item-body-0-value .ck-content').then(el => {
const editor = el[0].ckeditorInstance
editor.setData('Mentoring supports the growth of a vibrant HPC community by connecting students with experienced mentors. Matches are based on multiple factors, including research interests, career goals, long-term plans, and general interests. Providing valuable professional advice and resources that will benefit mentees which might include: sharing expertise in your specific research domain/discipline, sharing personal experiences and advice that might benefit your student mentee, encouraging students to stay abreast of scholarly literature and cutting-edge ideas in their field, Encouraging the open exchange of ideas, Facilitating networking opportunities with other faculty or professionals on campus or within the broader research community as appropriate.')
})

// get tag suggestions
// cy.get("#field-tags-replace input[type='submit']").click()

cy.get("details.tags summary").click()
cy.get("#tag-ai").click()

cy.get('.form-item-field-me-preferred-attributes-0-value .ck-content').then(el => {
const editor = el[0].ckeditorInstance
editor.setData('Be nice.')
})

cy.get('#edit-field-me-state').select('Recruiting')

cy.get(".node-mentorship-engagement-form #edit-submit").click()
});
});
20 changes: 20 additions & 0 deletions tests/cypress/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,26 @@ Cypress.Commands.add("loginAs", (username, password) => {
cy.get(".form-submit").contains("Log in").click();
});

/**
* User login command for default /user/login route.
*
* Requires valid username and password.
*
* @param {string} username
* The username with which to log in.
* @param {string} password
* The password for the user's account.
*/
Cypress.Commands.add("loginWith", (username, password) => {
cy.drupalLogout();
cy.visit("/user/login");
cy.get("#edit-name").type(username);
cy.get("#edit-pass").type(password, {
log: false,
});
cy.get(".form-submit").contains("Log in").click();
});

/**
* Logs a user in by their uid via drush uli.
*/
Expand Down
2 changes: 1 addition & 1 deletion web/sites/default/config/default/nect.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ connectci_front_text: "Welcome to Connect Cyberinfrastructure\r\n<div class=\"my
amp_front_text: "MATCH\r\n<div class=\"subtitle\">Multi-tier Assistance, Training & Computational Help</div>"
coco_front_text: 'Community of Communities'
usrse_front_text: ''
ccmnet_front_text: 'A peer-to-peer program for CI professionals to make connections and exchange knowledge'
ccmnet_front_text: "<p>Participate in mentorships to make connections and exchange knowledge.</p>\r\n<a class=\"btn btn-primary m-0\" href=\"/user/register/ccmnet\">Join Us</a>"
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
- node
- search_api
- ccmnet
- cssn
- webform_submission_search_api
id: mentorship_engagement
name: 'Mentorship Engagement'
Expand Down Expand Up @@ -88,6 +89,14 @@ field_settings:
dependencies:
module:
- node
title_1:
label: Title
datasource_id: 'entity:node'
property_path: title
type: text
dependencies:
module:
- node
uid:
label: uid
datasource_id: 'entity:node'
Expand Down Expand Up @@ -188,6 +197,7 @@ processor_settings:
ignored: ._-
overlap_cjk: 1
minimum_word_size: '3'
user_skills: { }
webform_submission_category: { }
webform_submission_description: { }
webform_submission_skill_level: { }
Expand Down
Loading

0 comments on commit 5b6ff9f

Please sign in to comment.