-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing/no auth testing branch #42
base: main
Are you sure you want to change the base?
Conversation
…3-H8rAid into testing/NoAuth-testingBranch
describe('App spec', () => { | ||
beforeEach(() => { | ||
cy.intercept('GET', '**/w/api.php?action=query&list=search**', { fixture: 'initialSearch.json' }).as('initialSearch'); | ||
cy.intercept('GET', '**/w/api.php?action=parse&prop=sections**', { fixture: 'sectionsRequest.json' }).as('sectionsRequest'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So glad this worked!
it('Handles show more/show less functionality', () => { | ||
cy.get('.card-content').should('be.visible'); | ||
cy.get('.card-content').first().click(); | ||
cy.get('p').should('contain', 'According to The Washington Post, \"the site\'s users have managed to pull off some of the highest-profile collective actions in the history of the Internet.\"[1]'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job rembmering uyou can use backslashes to put quotes into strings!!!
Great work fam! I am so glad we were able to figure this out and I could help with the intercepting and stubbing! claps |
env: { | ||
auth0_username: process.env.AUTH0_USERNAME, | ||
auth0_password: process.env.AUTH0_PASSWORD, | ||
auth0_domain: process.env.REACT_APP_AUTH0_DOMAIN, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need this auth stuff given that we arent testing it anymore?
cy.wait('@controversiesRequest'); | ||
}); | ||
|
||
it('should display all content on page load', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excellent use of the stubs and the waiting to make it load!
"continue": "-||" | ||
}, | ||
"query": { | ||
"searchinfo": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good fixture
|
||
{ | ||
"batchcomplete": "", | ||
"continue": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good fixture
displayName: 'AUTH0 LOGIN', | ||
message: [`🔐 Authenticating | ${username}`], | ||
autoEnd: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still wish we could have gotten auth0 testing to work! darn! but glad we made the progress we did!
@@ -35,6 +38,14 @@ function App() { | |||
randomSearch(); | |||
}, []); | |||
|
|||
const handleLogin = () => { | |||
setIsAuthenticated(true); // Set isAuthenticated to true on login button click | |||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glad i was able to get this part squared away for us!
hasError: false, | ||
errorMessage: '', | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Joey im glad you could get the error state working! I'm gonna be picking your brain about this later!
import { useNavigate } from "react-router-dom"; | ||
import { useAuth0 } from "@auth0/auth0-react"; | ||
// import React from "react"; | ||
// import { Auth0Provider } from "@auth0/auth0-react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a pain to figure out, glad you guys helped me with it
@@ -15,7 +15,7 @@ function WikipediaSearch({ saveControversy }) { | |||
setSearchInput(''); | |||
}; | |||
|
|||
const { isAuthenticated } = useAuth0(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as was this
domain={domain} | ||
clientId={clientId} | ||
authorizationParams={{ | ||
redirect_uri: "http://localhost:3000/" | ||
}} | ||
> | ||
> */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i cant wait for us to learn how to get the testing for it to work when we have more time!
reviewed! glad we all were able to contribute to this! |
What I did:
Hey Nick, this is our separate testing branch for our project. We could not get e2e testing involving with Auth0, so this is a branch that excludes that feature and tests the rest of our project. He have a login button in this branch. It just does not test Auth0
Did this break anything?
Type of change
Checklist: