Skip to content

Commit 8ed40c2

Browse files
authored
Merge branch 'main' into feat/escrow-milestone-dispute
2 parents ff3d96b + 876eace commit 8ed40c2

191 files changed

Lines changed: 21742 additions & 3956 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@ name: Soroban CI
22

33
on:
44
push:
5-
branches:
6-
- main
7-
- develop
85
paths:
96
- "soroban-client/**"
107
- "soroban-contract/**"
118
- ".github/workflows/**"
129
pull_request:
13-
branches:
14-
- main
15-
- develop
1610
paths:
1711
- "soroban-client/**"
1812
- "soroban-contract/**"
13+
- ".github/workflows/**"
1914

2015
jobs:
2116
client:
@@ -170,7 +165,6 @@ jobs:
170165
- name: Check contract formatting
171166
working-directory: soroban-contract
172167
run: cargo fmt --all -- --check
173-
continue-on-error: true
174168

175169
- name: Build contracts
176170
working-directory: soroban-contract
@@ -179,15 +173,17 @@ jobs:
179173
cargo build --release --target wasm32-unknown-unknown -p tba_account
180174
cargo build --release --target wasm32-unknown-unknown
181175
176+
- name: Run contract tests
177+
working-directory: soroban-contract
178+
run: cargo test --workspace --all-targets
179+
182180
- name: Optimize contracts
183181
working-directory: soroban-contract
184182
run: soroban contract optimize --wasm target/wasm32-unknown-unknown/release/*.wasm
185-
continue-on-error: true
186183

187184
- name: Run clippy
188185
working-directory: soroban-contract
189186
run: cargo clippy --all-targets -- -D warnings
190-
continue-on-error: true
191187

192188
- name: Run contract tests with coverage
193189
working-directory: soroban-contract
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import React from 'react';
2-
import { render, screen } from '@testing-library/react';
3-
import Footer from '../../components/Footer';
1+
import React from "react";
2+
import { render, screen } from "@testing-library/react";
3+
import Footer from "../../components/Footer";
44

5-
describe('Footer Component', () => {
6-
it('renders the copyright text properly', () => {
7-
render(<Footer />);
5+
describe("Footer Component", () => {
6+
it("renders the copyright text properly", () => {
7+
render(<Footer />);
88

9-
// The text is rendered across two spans, but we can search for the main substring
10-
expect(screen.getByText(/All Rights Reserved, CrowdPass/i)).toBeInTheDocument();
11-
});
9+
// The text is rendered across two spans, but we can search for the main substring
10+
expect(
11+
screen.getByText(/All Rights Reserved, CrowdPass/i),
12+
).toBeInTheDocument();
13+
});
1214
});
Lines changed: 74 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,89 @@
1-
import React from 'react';
2-
import { render, screen, fireEvent } from '@testing-library/react';
3-
import Header from '../../components/Header';
4-
import { useWallet } from '@/contexts/WalletContext';
1+
import React from "react";
2+
import { render, screen, fireEvent } from "@testing-library/react";
3+
import Header from "../../components/Header";
4+
import { useWallet } from "@/contexts/WalletContext";
55

66
// Mock Wallet Context Hook
7-
jest.mock('@/contexts/WalletContext', () => ({
8-
useWallet: jest.fn(),
7+
jest.mock("@/contexts/WalletContext", () => ({
8+
useWallet: jest.fn(),
99
}));
1010

11-
jest.mock('next/navigation', () => ({
12-
usePathname: () => '/',
11+
jest.mock("next/navigation", () => ({
12+
usePathname: () => "/",
1313
}));
1414

15-
describe('Header Component', () => {
16-
it('renders navigation links properly', () => {
17-
(useWallet as jest.Mock).mockReturnValue({
18-
address: null,
19-
providerId: 'freighter',
20-
providerName: 'Freighter',
21-
availableProviders: [],
22-
isConnected: false,
23-
isInstalled: true,
24-
connect: jest.fn(),
25-
disconnect: jest.fn(),
26-
setProviderId: jest.fn(),
27-
signTransaction: jest.fn(),
28-
});
29-
30-
render(<Header />);
31-
32-
expect(screen.getByText('CrowdPass')).toBeInTheDocument();
33-
// Home, Events, Analytics, and Create Events may appear multiple times (desktop + mobile)
34-
expect(screen.getAllByText('Home').length).toBeGreaterThan(0);
35-
expect(screen.getAllByText('Events').length).toBeGreaterThan(0);
36-
expect(screen.getAllByText('Analytics').length).toBeGreaterThan(0);
37-
expect(screen.getAllByText('Create Events').length).toBeGreaterThan(0);
38-
expect(screen.getAllByText('Connect Freighter').length).toBeGreaterThan(0);
15+
describe("Header Component", () => {
16+
it("renders navigation links properly", () => {
17+
(useWallet as jest.Mock).mockReturnValue({
18+
address: null,
19+
providerId: "freighter",
20+
providerName: "Freighter",
21+
availableProviders: [],
22+
isConnected: false,
23+
isInstalled: true,
24+
connect: jest.fn(),
25+
disconnect: jest.fn(),
26+
setProviderId: jest.fn(),
27+
signTransaction: jest.fn(),
3928
});
4029

41-
it('displays Install Freighter if wallet is not installed', () => {
42-
(useWallet as jest.Mock).mockReturnValue({
43-
address: null,
44-
providerId: 'freighter',
45-
providerName: 'Freighter',
46-
availableProviders: [],
47-
isConnected: false,
48-
isInstalled: false,
49-
connect: jest.fn(),
50-
disconnect: jest.fn(),
51-
setProviderId: jest.fn(),
52-
signTransaction: jest.fn(),
53-
});
30+
render(<Header />);
31+
32+
expect(screen.getByText("CrowdPass")).toBeInTheDocument();
33+
// Home, Events, Analytics, and Create Events may appear multiple times (desktop + mobile)
34+
expect(screen.getAllByText("Home").length).toBeGreaterThan(0);
35+
expect(screen.getAllByText("Events").length).toBeGreaterThan(0);
36+
expect(screen.getAllByText("Analytics").length).toBeGreaterThan(0);
37+
expect(screen.getAllByText("Create Events").length).toBeGreaterThan(0);
38+
expect(screen.getAllByText("Connect Freighter").length).toBeGreaterThan(0);
39+
});
5440

55-
render(<Header />);
56-
// Select Wallet may appear multiple times (desktop + mobile)
57-
expect(screen.getAllByText('Select Wallet').length).toBeGreaterThan(0);
41+
it("displays Install Freighter if wallet is not installed", () => {
42+
(useWallet as jest.Mock).mockReturnValue({
43+
address: null,
44+
providerId: "freighter",
45+
providerName: "Freighter",
46+
availableProviders: [],
47+
isConnected: false,
48+
isInstalled: false,
49+
connect: jest.fn(),
50+
disconnect: jest.fn(),
51+
setProviderId: jest.fn(),
52+
signTransaction: jest.fn(),
5853
});
5954

60-
it('renders connected wallet address prefix and disconnect button when connected', () => {
61-
const mockAddress = 'GBJ2V4YJ4V4BDK3NPGKQ2XZR2F2BQYQ2X2Y2Z2X2V2Y2Z2X2V2Y2Z2X2V2Y2';
62-
const disconnectMock = jest.fn();
55+
render(<Header />);
56+
// Select Wallet may appear multiple times (desktop + mobile)
57+
expect(screen.getAllByText("Select Wallet").length).toBeGreaterThan(0);
58+
});
6359

64-
(useWallet as jest.Mock).mockReturnValue({
65-
address: mockAddress,
66-
providerId: 'freighter',
67-
providerName: 'Freighter',
68-
availableProviders: [],
69-
isConnected: true,
70-
isInstalled: true,
71-
connect: jest.fn(),
72-
disconnect: disconnectMock,
73-
setProviderId: jest.fn(),
74-
signTransaction: jest.fn(),
75-
});
60+
it("renders connected wallet address prefix and disconnect button when connected", () => {
61+
const mockAddress =
62+
"GBJ2V4YJ4V4BDK3NPGKQ2XZR2F2BQYQ2X2Y2Z2X2V2Y2Z2X2V2Y2Z2X2V2Y2";
63+
const disconnectMock = jest.fn();
7664

77-
render(<Header />);
78-
const formattedAddress = 'GBJ2...V2Y2';
79-
// There are multiple address displays (desktop and mobile), so verify they exist
80-
expect(screen.getAllByText(formattedAddress).length).toBeGreaterThan(0);
81-
82-
// Disconnect buttons may appear multiple times (desktop + mobile)
83-
const disconnectBtns = screen.getAllByText('Disconnect');
84-
expect(disconnectBtns.length).toBeGreaterThan(0);
85-
fireEvent.click(disconnectBtns[0]);
86-
expect(disconnectMock).toHaveBeenCalledTimes(1);
65+
(useWallet as jest.Mock).mockReturnValue({
66+
address: mockAddress,
67+
providerId: "freighter",
68+
providerName: "Freighter",
69+
availableProviders: [],
70+
isConnected: true,
71+
isInstalled: true,
72+
connect: jest.fn(),
73+
disconnect: disconnectMock,
74+
setProviderId: jest.fn(),
75+
signTransaction: jest.fn(),
8776
});
77+
78+
render(<Header />);
79+
const formattedAddress = "GBJ2...V2Y2";
80+
// There are multiple address displays (desktop and mobile), so verify they exist
81+
expect(screen.getAllByText(formattedAddress).length).toBeGreaterThan(0);
82+
83+
// Disconnect buttons may appear multiple times (desktop + mobile)
84+
const disconnectBtns = screen.getAllByText("Disconnect");
85+
expect(disconnectBtns.length).toBeGreaterThan(0);
86+
fireEvent.click(disconnectBtns[0]);
87+
expect(disconnectMock).toHaveBeenCalledTimes(1);
88+
});
8889
});

soroban-client/__tests__/components/Hero.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ describe("Hero Component", () => {
88

99
// Using a loose string match because text might be broken into spans/lines
1010
expect(screen.getByText(/Secure Tickets/i)).toBeInTheDocument();
11+
<<<<<<< HEAD
12+
expect(screen.getByText(/Seamless Access/i)).toBeInTheDocument();
13+
=======
14+
>>>>>>> upstream/main
1115
});
1216

1317
it("renders the call to action buttons", () => {

0 commit comments

Comments
 (0)