Files
SHiNE-server/shine-UI/tests/registration-three-steps.test.mjs
T

29 lines
1.5 KiB
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
const read = relative => fs.readFileSync(new URL(relative, import.meta.url), 'utf8');
test('выбор аккаунта перед шагом 1, всего три шага', () => {
const choice = read('../js/pages/registration-choice-view.js');
const login = read('../js/pages/register-view.js');
const email = read('../js/pages/registration-email-view.js');
const payment = read('../js/pages/registration-payment-view.js');
assert.doesNotMatch(choice, /createRegistrationStepper\(/);
assert.match(login, /createRegistrationStepper\(1\)/);
assert.match(login, /createRegistrationStepper\(2\)/);
assert.match(email, /createRegistrationStepper\(3\)/);
assert.match(payment, /createRegistrationStepper\(3\)/);
});
test('реальная почта и 256-символьный лимит сохранены', () => {
const email = read('../js/pages/registration-email-view.js');
const passwords = read('../js/services/password-words.js');
assert.match(email, /startFreeRegistration\(/);
assert.match(email, /confirmFreeRegistration\(/);
assert.match(passwords, /PASSWORD_MAX_LENGTH = 256/);
});
test('экран поздравления объясняет различие статусов', () => {
const finish = read('../js/pages/registration-success-view.js');
assert.match(finish, /registrationSuccess\?\.flowType === 'paid'/);
assert.match(finish, /Arweave/);
assert.match(finish, /PDA/);
});