mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-24 21:19:07 +01:00
refactor
This commit is contained in:
parent
618d0eb0d1
commit
42c19f49bd
@ -2,8 +2,6 @@ describe('Basic', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.request('POST', '/api/reset-db').as('reset');
|
cy.request('POST', '/api/reset-db').as('reset');
|
||||||
cy.get('@reset').its('status').should('equal', 204);
|
cy.get('@reset').its('status').should('equal', 204);
|
||||||
cy.clearLocalStorage();
|
|
||||||
cy.clearCookies();
|
|
||||||
cy.reload(true);
|
cy.reload(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -121,17 +119,21 @@ describe('Basic', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('suspend', function() {
|
it('suspend', function() {
|
||||||
|
// インスタンス初期セットアップ
|
||||||
cy.request('POST', '/api/admin/accounts/create', {
|
cy.request('POST', '/api/admin/accounts/create', {
|
||||||
username: 'admin',
|
username: 'admin',
|
||||||
password: 'pass',
|
password: 'pass',
|
||||||
}).its('body').as('admin');
|
}).its('body').as('admin');
|
||||||
|
|
||||||
cy.request('POST', '/api/signup', {
|
cy.get('@admin').then(() => {
|
||||||
username: 'alice',
|
// ユーザー作成
|
||||||
password: 'pass',
|
cy.request('POST', '/api/signup', {
|
||||||
}).its('body').as('alice');
|
username: 'alice',
|
||||||
|
password: 'alice1234',
|
||||||
|
}).its('body').as('alice');
|
||||||
|
});
|
||||||
|
|
||||||
cy.then(() => {
|
cy.get('@alice').then(() => {
|
||||||
cy.request('POST', '/api/admin/suspend-user', {
|
cy.request('POST', '/api/admin/suspend-user', {
|
||||||
i: this.admin.token,
|
i: this.admin.token,
|
||||||
userId: this.alice.id,
|
userId: this.alice.id,
|
||||||
|
Loading…
Reference in New Issue
Block a user