Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2ff3bb1
feat: integration testing framework
stepanLav Oct 31, 2025
ca09bb1
Merge commit 'eb72315fa26321634a463a337239edd223cc5ce6' into fix/calc…
stepanLav Dec 22, 2025
2e6b868
feat: adding xcm integration test
stepanLav Dec 22, 2025
b314e96
fix: add dynamic whitelist
stepanLav Dec 22, 2025
685bb17
Merge branch 'dev' of https://github.com/novasamatech/nova-spektr int…
stepanLav Jan 15, 2026
352b437
feat: framework refactoring
stepanLav Jan 23, 2026
a87f2e8
fix: fixtures
stepanLav Jan 23, 2026
5c247a0
fix: remove redundant docs
stepanLav Jan 23, 2026
cac03c5
fix: refactoring
stepanLav Jan 23, 2026
da926ad
Merge branch 'dev' into fix/calculate_amount_rules
MaliDo Jan 26, 2026
4503da6
Merge branch 'dev' into fix/calculate_amount_rules
MaliDo Jan 28, 2026
97d2745
Merge branch 'dev' into fix/calculate_amount_rules
MaliDo Feb 4, 2026
14560b2
Merge branch 'dev' into fix/calculate_amount_rules
MaliDo Feb 6, 2026
bbeed79
fix: governance tests update (#5566)
MaliDo Feb 12, 2026
be373b3
Merge branch 'dev' into fix/calculate_amount_rules
stepanLav Feb 12, 2026
17e24e9
fix: linter
stepanLav Feb 12, 2026
925a8c4
fix: circular import for lockPeriodsModel
stepanLav Feb 12, 2026
44a7331
chore: remove XCM destination generator logic (moved to feat/xcm_dest…
stepanLav Feb 12, 2026
e96efa0
Merge branch 'dev' into fix/calculate_amount_rules
MaliDo Mar 10, 2026
c12d521
Merge branch 'dev' into fix/calculate_amount_rules
stepanLav Mar 11, 2026
06f98cf
fix: type assertion
stepanLav Mar 11, 2026
76b0fcd
fix: linter
stepanLav Mar 11, 2026
a2ca1d6
fix: add claude.md file
stepanLav Mar 11, 2026
243b248
fix: timeout for transfer tests
stepanLav Mar 11, 2026
ab08f2e
fix: patallel run timeouts
stepanLav Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .allure/categories.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"name": "Product Bugs",
"description": "Test failures caused by actual product defects",
"matchedStatuses": ["failed"],
"messageRegex": ".*AssertionError.*"
},
{
"name": "Test Defects",
"description": "Failures caused by test code issues (not product bugs)",
"matchedStatuses": ["broken"],
"messageRegex": ".*TypeError.*|.*ReferenceError.*|.*SyntaxError.*"
},
{
"name": "Infrastructure Issues",
"description": "Failures caused by environment or infrastructure problems",
"matchedStatuses": ["broken", "failed"],
"messageRegex": ".*ECONNREFUSED.*|.*ETIMEDOUT.*|.*network.*|.*timeout.*"
},
{
"name": "Flaky Tests",
"description": "Tests that intermittently fail without code changes",
"matchedStatuses": ["failed", "broken"],
"flaky": true
},
{
"name": "Known Issues",
"description": "Tests with known issues that are being tracked",
"matchedStatuses": ["failed"],
"messageRegex": ".*@known-issue.*|.*TODO.*|.*FIXME.*"
}
]
67 changes: 67 additions & 0 deletions .github/workflows/tests_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Integration tests

on:
workflow_dispatch:
inputs:
ALLURE_JOB_RUN_ID:
type: string
description: ALLURE_JOB_RUN_ID service parameter. Leave blank.
required: false
ALLURE_USERNAME:
type: string
description: ALLURE_USERNAME service parameter. Leave blank.
required: false
push:
branches:
- 'dev'
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
pull-requests: write
checks: write

env:
NODE_OPTIONS: "--max-old-space-size=8192"
CI: true
ALLURE_ENDPOINT: https://nova.testops.cloud/
ALLURE_PROJECT_ID: 1
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }}
ALLURE_JOB_RUN_ID: ${{ github.event.inputs.ALLURE_JOB_RUN_ID }}
ALLURE_RESULTS: allure-results

jobs:
integration-tests:
runs-on: ubuntu-latest

steps:
- name: ⚙️Checkout
uses: actions/checkout@v4

- name: ⚙️Install dependencies
uses: ./.github/workflows/install-pnpm

- name: Install allurectl
uses: allure-framework/setup-allurectl@v1

- name: 🧪 Run integration tests
id: vitest_tests
run: allurectl watch -- pnpm test:integration

- name: Create Allure testplan if missing
if: always()
run: |
mkdir -p .allure
echo '{}' > .allure/testplan.json

- name: 📄 Post results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: ./junit.xml
check_name: 'Integration Test Results'
comment_mode: 'changes'
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/tests_system_integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- cron: '0 6 * * *' # 9:00 GMT+3
pull_request:
paths:
- 'tests/**'
- 'tests/system/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_system_regress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
- 'dev'
pull_request:
paths:
- 'tests/**'
- 'tests/system/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: ./.github/workflows/install-pnpm

- name: 🧪 Run tests
run: pnpm test
run: pnpm test:unit

- name: 📄 Post results
if: always()
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ schema.graphql
/playwright/.cache/
allure-results

.cursor
CLAUDE.md
.cursor
8 changes: 8 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ Nova Spektr is a Polkadot & Kusama ecosystem Enterprise Desktop application buil
- `pnpm test:ui` - Run tests with UI
- `pnpm test:coverage` - Run tests with coverage report
- `pnpm test:system` - Run end-to-end tests (Playwright)
- `pnpm test tests/integrations` - Run integration tests

#### Integration Tests
Integration tests live in `tests/integrations/` and test feature model logic (Effector stores/events), storage persistence (IndexedDB), state management workflows, validation rules, and transaction building. They use a custom FeatureTestBuilder/FeatureTestEnvironment framework with fake IndexedDB and isolated Effector scopes.

**When to use**: Multi-step business logic spanning stores, events, and storage. Not for UI rendering (component tests), pure functions (unit tests), or full user flows (E2E/Playwright).

See [`tests/integrations/CLAUDE.md`](tests/integrations/CLAUDE.md) for the complete framework reference.

### Code Quality
- `pnpm lint` - Run ESLint on source code
Expand Down
80 changes: 80 additions & 0 deletions allure.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/**
* Allure Report Configuration
*
* This configuration file defines categories for test failures, environment
* info collection, and history trends settings.
*
* @see https://allurereport.org/docs/
*/

module.exports = {
/**
* Categories define how test failures are classified in the report. Each
* category has a name, matching criteria, and optional styling.
*/
categories: [
{
name: 'Product Bugs',
description: 'Test failures caused by actual product defects',
matchedStatuses: ['failed'],
messageRegex: '.*AssertionError.*',
},
{
name: 'Test Defects',
description: 'Failures caused by test code issues (not product bugs)',
matchedStatuses: ['broken'],
messageRegex: '.*TypeError.*|.*ReferenceError.*|.*SyntaxError.*',
},
{
name: 'Infrastructure Issues',
description: 'Failures caused by environment or infrastructure problems',
matchedStatuses: ['broken', 'failed'],
messageRegex: '.*ECONNREFUSED.*|.*ETIMEDOUT.*|.*network.*|.*timeout.*',
},
{
name: 'Flaky Tests',
description: 'Tests that intermittently fail without code changes',
matchedStatuses: ['failed', 'broken'],
flaky: true,
},
{
name: 'Known Issues',
description: 'Tests with known issues that are being tracked',
matchedStatuses: ['failed'],
messageRegex: '.*@known-issue.*|.*TODO.*|.*FIXME.*',
},
],

/**
* Environment info to be collected and displayed in the report. This helps
* identify the test execution context.
*/
environment: {
'Node.js': process.version,
Platform: process.platform,
Arch: process.arch,
'Test Framework': 'Vitest',
'Allure Reporter': 'allure-vitest',
},

/**
* History configuration for trend analysis. Enables tracking test results
* across multiple runs.
*/
history: {
enabled: true,
historyDir: './allure-results/history',
},

/**
* Executor info for CI/CD integration. This is typically set via environment
* variables in CI.
*/
executor: {
name: process.env.CI_NAME || 'Local',
type: process.env.CI ? 'CI' : 'local',
buildName: process.env.CI_BUILD_NAME || 'Local Build',
buildUrl: process.env.CI_BUILD_URL || '',
reportUrl: process.env.CI_REPORT_URL || '',
},
};
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"staging:sequence": "pnpm r clean:build clean:prod build:staging postbuild:staging dist:staging",
"prod:sequence": "pnpm r clean:build clean:prod build postbuild dist",
"test": "cross-env POLKADOTJS_DISABLE_ESM_CJS_WARNING=1 vitest run",
"test:unit": "cross-env POLKADOTJS_DISABLE_ESM_CJS_WARNING=1 vitest run src/",
"test:integration": "cross-env POLKADOTJS_DISABLE_ESM_CJS_WARNING=1 vitest run --config tests/integrations/vitest.config.ts",
"test:ui": "cross-env POLKADOTJS_DISABLE_ESM_CJS_WARNING=1 vitest --ui",
"test:watch": "cross-env POLKADOTJS_DISABLE_ESM_CJS_WARNING=1 vitest",
"test:coverage": "cross-env POLKADOTJS_DISABLE_ESM_CJS_WARNING=1 vitest run --coverage",
Expand Down Expand Up @@ -213,6 +215,7 @@
"@vitest/ui": "3.2.4",
"allure-js-commons": "3.2.0",
"allure-playwright": "3.0.6",
"allure-vitest": "3.4.5",
"astro": "5.13.1",
"camelcase": "6.3.0",
"concurrently": "7.6.0",
Expand Down
31 changes: 31 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getAssetById, getNativeAsset, transferableAmount } from '@/shared/lib/u
import { balanceModel, balanceUtils } from '@/entities/balance';
import { networkModel } from '@/entities/network';
import { transactionService } from '@/entities/transaction';
import { lockPeriodsModel } from '@/features/governance';
import { lockPeriodsModel } from '@/features/governance/model/lockPeriods';
import { type BalanceMap as TransferBalanceMap, type NetworkStore } from '@/features/transfer';
import { DelegateRules } from '../lib/delegate-rules';
import { validationUtils } from '../lib/validation-utils';
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/features/transfer/model/form-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,12 +692,13 @@ const $availableBalance = combine(
);

sample({
clock: setMaxMode.filter({ fn: (enabled) => enabled }),
clock: [setMaxMode.filter({ fn: (enabled) => enabled }), $balancePreservationStrategy],
source: {
balance: $availableBalance,
balancePreservationStrategy: $balancePreservationStrategy,
isMaxModeEnabled: $isMaxModeEnabled,
},
filter: ({ balance }) => nonNullable(balance),
filter: ({ balance, isMaxModeEnabled }) => nonNullable(balance) && isMaxModeEnabled,
fn: ({ balance, balancePreservationStrategy }) =>
balanceService.withdrawableAmount(balance!, balancePreservationStrategy),
target: $maxModeAvailableBalanceAfterFees,
Expand Down
Loading
Loading