This commit is contained in:
syuilo 2021-09-19 02:58:25 +09:00
parent 91171c559a
commit 186163ec3f
1 changed files with 9 additions and 7 deletions

View File

@ -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.get('@admin').then(() => {
// ユーザー作成
cy.request('POST', '/api/signup', { cy.request('POST', '/api/signup', {
username: 'alice', username: 'alice',
password: 'pass', password: 'alice1234',
}).its('body').as('alice'); }).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,