fix: reset password regression (#1574)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { buildConfig } from '../buildConfig';
|
||||
import { devUser } from '../credentials';
|
||||
|
||||
export const slug = 'users';
|
||||
|
||||
@@ -33,8 +34,16 @@ export default buildConfig({
|
||||
saveToJWT: true,
|
||||
hasMany: true,
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
],
|
||||
onInit: async (payload) => {
|
||||
await payload.create({
|
||||
collection: 'users',
|
||||
data: {
|
||||
email: devUser.email,
|
||||
password: devUser.password,
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
46
test/auth/e2e.spec.ts
Normal file
46
test/auth/e2e.spec.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
import { expect, test } from '@playwright/test';
|
||||
import { AdminUrlUtil } from '../helpers/adminUrlUtil';
|
||||
import { initPayloadE2E } from '../helpers/configHelpers';
|
||||
import { login, saveDocAndAssert } from '../helpers';
|
||||
import { slug } from './config';
|
||||
|
||||
/**
|
||||
* TODO: Auth
|
||||
* create first user
|
||||
* unlock
|
||||
* generate api key
|
||||
* log out
|
||||
*/
|
||||
|
||||
const { beforeAll, describe } = test;
|
||||
let url: AdminUrlUtil;
|
||||
|
||||
describe('auth', () => {
|
||||
let page: Page;
|
||||
|
||||
beforeAll(async ({ browser }) => {
|
||||
const { serverURL } = await initPayloadE2E(__dirname);
|
||||
url = new AdminUrlUtil(serverURL, slug);
|
||||
|
||||
const context = await browser.newContext();
|
||||
page = await context.newPage();
|
||||
|
||||
await login({
|
||||
page,
|
||||
serverURL,
|
||||
});
|
||||
});
|
||||
|
||||
describe('authenticated users', () => {
|
||||
test('should allow change password', async () => {
|
||||
await page.goto(url.account);
|
||||
|
||||
await page.locator('#change-password').click();
|
||||
await page.locator('#field-password').fill('password');
|
||||
await page.locator('#field-confirm-password').fill('password');
|
||||
|
||||
await saveDocAndAssert(page);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
import { expect, test } from '@playwright/test';
|
||||
import { AdminUrlUtil } from '../helpers/adminUrlUtil';
|
||||
import { initPayloadTest } from '../helpers/configHelpers';
|
||||
import { firstRegister } from '../helpers';
|
||||
import { slug } from './config';
|
||||
|
||||
/**
|
||||
* TODO: Auth
|
||||
* change password
|
||||
* unlock
|
||||
* generate api key
|
||||
* log out
|
||||
*/
|
||||
|
||||
const { beforeAll, describe } = test;
|
||||
let url: AdminUrlUtil;
|
||||
Reference in New Issue
Block a user