Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions __tests__/lib/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,20 @@ describe('cn', () => {
expect(cn('font-bold', 'font-normal')).toBe('font-normal')
})

it('later margin utility wins over earlier one', () => {
expect(cn('m-4', 'm-2')).toBe('m-2')
})

it('later axis-specific padding wins over earlier axis-specific padding', () => {
expect(cn('px-4', 'px-2')).toBe('px-2')
})

it('keeps padding-x and padding-y as they target different axes', () => {
const result = cn('px-4', 'py-2')
expect(result).toContain('px-4')
expect(result).toContain('py-2')
})

it('keeps non-conflicting utilities from both sides', () => {
// flex and p-2 are different groups — both should survive.
const result = cn('flex p-4', 'p-2')
Expand Down
21 changes: 21 additions & 0 deletions contracts/streaming/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,27 @@ fn test_set_delegate_by_recipient() {
assert_eq!(stored_delegate, Some(delegate));
}

#[test]
fn test_get_delegate_none_when_never_set() {
let t = TestEnv::setup();
let now = 1_000_000u64;
t.set_time(now);
let client = t.client();
let params = t.default_params(now);
let total = params.total_amount;

t.token().approve(
&t.sender,
&t.contract_id,
&total,
&(t.env.ledger().sequence() + 500),
);
let stream_id = client.create_stream(&t.sender, &params);

// No delegate was ever set on this stream.
assert_eq!(client.get_delegate(&stream_id), None);
}

#[test]
fn test_delegate_can_withdraw() {
let t = TestEnv::setup();
Expand Down