@reown/appkit-controllers
Version:
#### 🔗 [Website](https://reown.com/appkit)
21 lines • 1.2 kB
JavaScript
import { describe, expect, it, vi } from 'vitest';
import {} from '@reown/appkit-common';
import { ConnectorController } from '../../src/controllers/ConnectorController.js';
import { ConnectorControllerUtil } from '../../src/utils/ConnectorControllerUtil.js';
describe('checkNamespaceConnectorId', () => {
it('should return true if the namespace is associated with the specified connector id', () => {
const namespace = 'eip155';
const connectorId = 'eip155-connector';
vi.spyOn(ConnectorController, 'getConnectorId').mockReturnValue(connectorId);
const result = ConnectorControllerUtil.checkNamespaceConnectorId(namespace, connectorId);
expect(result).toBe(true);
});
it('should return false if the namespace is not associated with the specified connector id', () => {
const namespace = 'eip155';
const connectorId = 'eip155-connector';
vi.spyOn(ConnectorController, 'getConnectorId').mockReturnValue('different-connector');
const result = ConnectorControllerUtil.checkNamespaceConnectorId(namespace, connectorId);
expect(result).toBe(false);
});
});
//# sourceMappingURL=ConnectorControllerUtil.test.js.map