Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update favicon
  • Loading branch information
jgiwinski committed Jan 29, 2024
1 parent 0adb1c5 commit 7dd4b5d
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 3 deletions.
9 changes: 9 additions & 0 deletions cypress.config.js
@@ -0,0 +1,9 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
Binary file added cypress/downloads/downloads.html
Binary file not shown.
62 changes: 62 additions & 0 deletions cypress/e2e/spec.cy.js
@@ -0,0 +1,62 @@
context('SACDS', () => {
beforeEach(() => {
cy.visit('http://localhost:3000/')
})

describe('Page display', () => {

it('Displays Incommon logo', () => {
cy.get('img')
.should('be.visible')
.should('have.class', 'logo')
})

it('Displays information text', () => {

})

it('Displays Seamless Action button on page', () => {
cy.get('a.sa-button')
.should('be.visible')
.and('have.attr', 'href')
.then((hrefAttribute) => {
// Extract entityID and returnUrl from the href attribute
const urlParams = new URLSearchParams(hrefAttribute);
const entityID = urlParams.get('entityID');
const returnUrl = urlParams.get('return');

// Assert that entityID and returnUrl are present and not empty
expect(entityID).to.be.a('string').and.not.empty;
expect(returnUrl).to.be.a('string').and.not.empty;

cy.get('.sa-button-logo').should('be.visible');
cy.get('.sa-button-text').should('be.visible').and('contain.text', 'Access through your institution');
});
})

it('Hides SA button and displays error message and wiki link if entityID or returnUrl are missing', () => {
cy.get('.sa-button').should('not.exist');
cy.get('h1').should('be.visible').and('contain.text', 'Both Entity ID and return URL are required.');
cy.get('p a')
.should('be.visible')
.and('have.attr', 'href', 'LINK_FROM_I2');
cy.get('p a').should('contain.text', 'Click Here for more information.');
})

})

describe('SA button functionality', () => {

it('Takes in entityID and returnUrl from URL and feeds to SA button', () => {

})

it('Routes user to their entity after clicking SA button', () => {

})

})
})



5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
25 changes: 25 additions & 0 deletions cypress/support/commands.js
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/e2e.js
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
Binary file modified public/favicon.ico
Binary file not shown.
6 changes: 3 additions & 3 deletions src/App.js
Expand Up @@ -33,17 +33,17 @@ function App() {
setReturnUrl(returnUrlParam);
}

console.log('IDs', entityID, returnUrl)
console.log('IDs', entityIdParam, returnUrlParam)
}, []);

return (
<div className="app d-flex">
<div className="d-flex column align-items-center container box-with-shadow">
<img src={logo} className="logo" alt="InCommon-Logo" />
{!error ? (
{error ? (
<>
<h1>{error}</h1>
<p><a href="LINK_FROM_I2">Click Here</a> for more information.</p>
<p><a href="LINK_FROM_I2" target="_blank">Click Here</a> for more information.</p>
</>
) : (
<>
Expand Down

0 comments on commit 7dd4b5d

Please sign in to comment.