|
1 | 1 | import { describe, expect, test, vi } from 'vitest'; |
2 | 2 | import { NetworkFacade } from '../../../src/services/network/network-facade.service'; |
3 | | -import { SdkManager } from '../../../src/services/sdk-manager.service'; |
4 | 3 | import path from 'node:path'; |
5 | 4 | import { createReadStream } from 'node:fs'; |
6 | 5 | import { DownloadService } from '../../../src/services/network/download.service'; |
7 | 6 | import { Readable } from 'node:stream'; |
8 | 7 | import axios from 'axios'; |
9 | 8 | import { fail } from 'node:assert'; |
10 | | -import { Environment } from '@internxt/inxt-js'; |
11 | | -import { ConfigService } from '../../../src/services/config.service'; |
12 | | -import { UserFixture } from '../../fixtures/auth.fixture'; |
13 | 9 | import { UsageService } from '../../../src/services/usage.service'; |
| 10 | +import { getEnvironmentMock, getNetworkMock } from '../../fixtures/webdav.fixture'; |
14 | 11 |
|
15 | 12 | describe('Network Facade Service', () => { |
16 | | - const getNetworkMock = () => { |
17 | | - return SdkManager.instance.getNetwork({ |
18 | | - user: 'user', |
19 | | - pass: 'pass', |
20 | | - }); |
21 | | - }; |
22 | | - |
23 | | - const getEnvironmentMock = () => { |
24 | | - return new Environment({ |
25 | | - bridgeUser: 'user', |
26 | | - bridgePass: 'pass', |
27 | | - bridgeUrl: ConfigService.instance.get('NETWORK_URL'), |
28 | | - encryptionKey: UserFixture.mnemonic, |
29 | | - appDetails: SdkManager.getAppDetails(), |
30 | | - }); |
31 | | - }; |
32 | | - |
33 | 13 | test('when a file is uploaded, then the upload functionality is called', async () => { |
34 | 14 | const mockEnvironment = { |
35 | 15 | upload: vi.fn(), |
|
0 commit comments