-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): Upgrade to Django 5 (#23626)
- Loading branch information
Showing
60 changed files
with
375 additions
and
667 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
describe('Auth', () => { | ||
beforeEach(() => { | ||
cy.get('[data-attr=menu-item-me]').click() | ||
}) | ||
import { auth } from '../support' | ||
|
||
describe('Auth', () => { | ||
it('Logout', () => { | ||
cy.get('[data-attr=top-menu-item-logout]').click() | ||
cy.location('pathname').should('eq', '/login') | ||
auth.logout() | ||
}) | ||
|
||
it('Logout and login', () => { | ||
cy.get('[data-attr=top-menu-item-logout]').click() | ||
auth.logout() | ||
|
||
cy.get('[data-attr=login-email]').type('[email protected]').should('have.value', '[email protected]').blur() | ||
cy.get('[data-attr=password]', { timeout: 5000 }).should('be.visible') // Wait for login precheck (note blur above) | ||
|
@@ -22,7 +19,7 @@ describe('Auth', () => { | |
}) | ||
|
||
it('Logout and verify that Google login button has correct link', () => { | ||
cy.get('[data-attr=top-menu-item-logout]').click() | ||
auth.logout() | ||
|
||
cy.window().then((win) => { | ||
win.POSTHOG_APP_CONTEXT.preflight.available_social_auth_providers = { | ||
|
@@ -34,7 +31,7 @@ describe('Auth', () => { | |
}) | ||
|
||
it('Try logging in improperly and then properly', () => { | ||
cy.get('[data-attr=top-menu-item-logout]').click() | ||
auth.logout() | ||
|
||
cy.get('[data-attr=login-email]').type('[email protected]').should('have.value', '[email protected]').blur() | ||
cy.get('[data-attr=password]', { timeout: 5000 }).should('be.visible') // Wait for login precheck (note blur above) | ||
|
@@ -50,8 +47,7 @@ describe('Auth', () => { | |
}) | ||
|
||
it('Redirect to appropriate place after login', () => { | ||
cy.visit('/logout') | ||
cy.location('pathname').should('include', '/login') | ||
auth.logout() | ||
|
||
cy.visit('/activity/explore') | ||
cy.location('pathname').should('include', '/login') // Should be redirected to login because we're now logged out | ||
|
@@ -65,8 +61,7 @@ describe('Auth', () => { | |
}) | ||
|
||
it('Redirect to appropriate place after login with complex URL', () => { | ||
cy.visit('/logout') | ||
cy.location('pathname').should('include', '/login') | ||
auth.logout() | ||
|
||
cy.visit('/insights?search=testString') | ||
cy.location('pathname').should('include', '/login') // Should be redirected to login because we're now logged out | ||
|
@@ -84,15 +79,4 @@ describe('Auth', () => { | |
cy.visit('/signup') | ||
cy.location('pathname').should('eq', '/project/1') | ||
}) | ||
|
||
it('Logout in another tab results in logout in the current tab too', () => { | ||
cy.window().then(async (win) => { | ||
// Hit /logout *in the background* by using fetch() | ||
await win.fetch('/logout') | ||
}) | ||
|
||
cy.clickNavMenu('dashboards') // This should cause logout bacause of new data fetching being initiated | ||
|
||
cy.location('pathname').should('eq', '/login') // We should be quickly redirected to the login page | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import { decideResponse } from '../fixtures/api/decide' | ||
import { auth } from '../support' | ||
|
||
const VALID_PASSWORD = 'hedgE-hog-123%' | ||
|
||
describe('Signup', () => { | ||
beforeEach(() => { | ||
cy.get('[data-attr=menu-item-me]').click() | ||
cy.get('[data-attr=top-menu-item-logout]').click() | ||
cy.location('pathname').should('include', '/login') | ||
auth.logout() | ||
cy.visit('/signup') | ||
}) | ||
|
||
|
@@ -146,8 +145,7 @@ describe('Signup', () => { | |
// We can't actually test the social login feature. | ||
// But, we can make sure the form exists as it should, and that upon submit | ||
// we get the expected error that no social session exists. | ||
cy.visit('/logout') | ||
cy.location('pathname').should('include', '/login') | ||
cy.clearAllCookies() | ||
cy.visit('/organization/confirm-creation?organization_name=&first_name=Test&email=test%40posthog.com') | ||
|
||
cy.get('[name=email]').should('have.value', '[email protected]') | ||
|
@@ -170,8 +168,7 @@ describe('Signup', () => { | |
) | ||
) | ||
|
||
cy.visit('/logout') | ||
cy.location('pathname').should('include', '/login') | ||
cy.clearAllCookies() | ||
|
||
cy.visit('/signup?maintenanceRedirect=true', { | ||
onLoad(win: Cypress.AUTWindow) { | ||
|
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.