Skip to content
Closed
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
6 changes: 3 additions & 3 deletions tests/test-gain-controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ async function testGainControls() {
muteButton.click();

// Check if button text changed and slider disabled
const isMuted = muteButton.textContent.toLowerCase().includes('muted');
const isMuted = muteButton.textContent.includes('已静音');
const isDisabled = slider.disabled;

console.log(`[Test] Mute button text: ${muteButton.textContent}`);
Expand Down Expand Up @@ -211,12 +211,12 @@ async function testGainControls() {
const muteButton = card.querySelector('.mute-button');
const slider = card.querySelector('.gain-slider');

if (muteButton && slider && muteButton.textContent.toLowerCase().includes('muted') && !muteButton.textContent.toLowerCase().includes('unmuted')) {
if (muteButton && slider && muteButton.textContent.includes('已静音') && !muteButton.textContent.includes('未静音')) {
// Click unmute
muteButton.click();

// Check if button text changed and slider enabled
const isUnmuted = muteButton.textContent.toLowerCase().includes('unmuted');
const isUnmuted = muteButton.textContent.includes('未静音');
const isEnabled = !slider.disabled;

console.log(`[Test] Unmute button text: ${muteButton.textContent}`);
Expand Down
6 changes: 3 additions & 3 deletions tests/test-mix-minus.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async function runTest() {

// Wait for connection to signaling server
console.log('[A] Waiting for connection...');
const aConnected = await waitForStatus(peerA.page, 'Connected');
const aConnected = await waitForStatus(peerA.page, '已连接');
if (!aConnected) {
throw new Error('A failed to connect to signaling server');
}
Expand Down Expand Up @@ -174,7 +174,7 @@ async function runTest() {

// Wait for connection
console.log('[B] Waiting for connection...');
const bConnected = await waitForStatus(peerB.page, 'Connected');
const bConnected = await waitForStatus(peerB.page, '已连接');
if (!bConnected) {
throw new Error('B failed to connect to signaling server');
}
Expand Down Expand Up @@ -213,7 +213,7 @@ async function runTest() {

// Wait for connection
console.log('[C] Waiting for connection...');
const cConnected = await waitForStatus(peerC.page, 'Connected');
const cConnected = await waitForStatus(peerC.page, '已连接');
if (!cConnected) {
throw new Error('C failed to connect to signaling server');
}
Expand Down
14 changes: 7 additions & 7 deletions tests/test-mute-controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async function testMuteControls() {

console.log(` Host sees caller button: "${initialButtonText}" (class: ${initialButtonClass})`);

if (initialButtonText.toLowerCase().includes('unmuted') && !initialButtonClass.includes('self-muted') && !initialButtonClass.includes('producer-muted')) {
if (initialButtonText.includes('未静音') && !initialButtonClass.includes('self-muted') && !initialButtonClass.includes('producer-muted')) {
console.log(' ✅ PASS: Caller initially unmuted (green state)');
} else {
console.log(' ❌ FAIL: Expected unmuted state');
Expand All @@ -140,7 +140,7 @@ async function testMuteControls() {
const selfButtonClass = await selfMuteButtonOnCaller.getAttribute('class');
console.log(` Caller sees own button: "${selfButtonText}" (class: ${selfButtonClass})`);

if (selfButtonText.toLowerCase().includes('muted') && selfButtonClass.includes('self-muted')) {
if (selfButtonText.includes('已静音') && selfButtonClass.includes('self-muted')) {
console.log(' ✅ PASS: Caller shows self-muted state (yellow)');
} else {
console.log(' ❌ FAIL: Expected self-muted state');
Expand All @@ -153,7 +153,7 @@ async function testMuteControls() {
const hostSeesButtonClass = await muteButtonOnHost.getAttribute('class');
console.log(` Host sees caller button: "${hostSeesButtonText}" (class: ${hostSeesButtonClass})`);

if (hostSeesButtonText.toLowerCase().includes('muted')) {
if (hostSeesButtonText.includes('已静音')) {
console.log(' ✅ PASS: Mute state propagated to host');
} else {
console.log(' ❌ FAIL: Mute state did not propagate');
Expand All @@ -177,7 +177,7 @@ async function testMuteControls() {
const callerSeesClass = await selfMuteButtonOnCaller.getAttribute('class');
console.log(` Caller sees: "${callerSeesUnmuted}" (class: ${callerSeesClass})`);

if (hostSeesUnmuted.toLowerCase().includes('unmuted') && callerSeesUnmuted.toLowerCase().includes('unmuted')) {
if (hostSeesUnmuted.includes('未静音') && callerSeesUnmuted.includes('未静音')) {
console.log(' ✅ PASS: Producer authority overrode self-mute');
} else {
console.log(' ❌ FAIL: Producer authority did not override self-mute');
Expand All @@ -202,7 +202,7 @@ async function testMuteControls() {
const callerSeesProducerClass = await selfMuteButtonOnCaller.getAttribute('class');
console.log(` Caller sees: "${callerSeesProducerMuted}" (class: ${callerSeesProducerClass})`);

if (callerSeesProducerMuted.toLowerCase().includes('muted') && callerSeesProducerMuted.toLowerCase().includes('host') && callerSeesProducerClass.includes('producer-muted')) {
if (callerSeesProducerMuted.includes('已静音') && callerSeesProducerMuted.includes('主播') && callerSeesProducerClass.includes('producer-muted')) {
console.log(' ✅ PASS: Caller shows producer-muted state (red, with "Host" label)');
} else {
console.log(' ❌ FAIL: Expected producer-muted state with "Host" label');
Expand All @@ -223,7 +223,7 @@ async function testMuteControls() {

// Note: Due to conflict resolution, the mute should remain with producer authority
// The button click might show an alert, but state should not change
if (stillMutedText.toLowerCase().includes('muted')) {
if (stillMutedText.includes('已静音')) {
console.log(' ✅ PASS: Caller remains muted (producer authority blocks self-unmute)');
} else {
console.log(' ⚠️ WARNING: Caller appears unmuted (check conflict resolution logic)');
Expand Down Expand Up @@ -268,7 +268,7 @@ async function testMuteControls() {
const callerFinalClass = await selfMuteButtonOnCaller.getAttribute('class');
console.log(` Caller sees: "${callerFinalText}" (class: ${callerFinalClass})`);

if (finalButtonText.toLowerCase().includes('unmuted') && callerFinalText.toLowerCase().includes('unmuted')) {
if (finalButtonText.includes('未静音') && callerFinalText.includes('未静音')) {
console.log(' ✅ PASS: Full mute cycle completed successfully');
} else {
console.log(' ❌ FAIL: Full mute cycle did not complete correctly');
Expand Down
4 changes: 2 additions & 2 deletions tests/test-return-feed.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ async function runTest() {
await peerA.page.goto(WEB_SERVER_URL);

console.log('[A] Waiting for connection...');
const aConnected = await waitForStatus(peerA.page, 'Connected');
const aConnected = await waitForStatus(peerA.page, '已连接');
if (!aConnected) {
throw new Error('A failed to connect to signaling server');
}
Expand Down Expand Up @@ -204,7 +204,7 @@ async function runTest() {
await peerB.page.goto(`${WEB_SERVER_URL}#${roomId}`);

console.log('[B] Waiting for connection...');
const bConnected = await waitForStatus(peerB.page, 'Connected');
const bConnected = await waitForStatus(peerB.page, '已连接');
if (!bConnected) {
throw new Error('B failed to connect to signaling server');
}
Expand Down
20 changes: 10 additions & 10 deletions tests/test-webrtc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async function runTest() {

// Wait for connection to signaling server
console.log('[Host] Waiting for connection to signaling server...');
const hostConnected = await waitForStatus(hostBrowser.page, 'Connected');
const hostConnected = await waitForStatus(hostBrowser.page, '已连接');
if (!hostConnected) {
throw new Error('Host failed to connect to signaling server');
}
Expand Down Expand Up @@ -163,7 +163,7 @@ async function runTest() {

// Wait for connection
console.log('[Caller] Waiting for connection to signaling server...');
const callerConnected = await waitForStatus(callerBrowser.page, 'Connected');
const callerConnected = await waitForStatus(callerBrowser.page, '已连接');
if (!callerConnected) {
throw new Error('Caller failed to connect to signaling server');
}
Expand Down Expand Up @@ -222,8 +222,8 @@ async function runTest() {
console.log(`[Caller] Participant statuses: ${JSON.stringify(callerParticipantStatus)}`);

// Check if at least one connection shows "Connected"
const hasConnectedPeer = hostParticipantStatus.some(s => s.includes('Connected')) ||
callerParticipantStatus.some(s => s.includes('Connected'));
const hasConnectedPeer = hostParticipantStatus.some(s => s.includes('已连接')) ||
callerParticipantStatus.some(s => s.includes('已连接'));

if (hasConnectedPeer) {
console.log('✅ WebRTC peer connection established\n');
Expand Down Expand Up @@ -252,10 +252,10 @@ async function runTest() {
'#toggle-mute',
btn => btn.textContent
);
if (muteButtonText !== 'Unmute') {
throw new Error(`Expected "Unmute", got "${muteButtonText}"`);
if (muteButtonText !== '取消静音') {
throw new Error(`Expected "取消静音", got "${muteButtonText}"`);
}
console.log('✅ Mute toggle working (text changed to "Unmute")');
console.log('✅ Mute toggle working (text changed to "取消静音")');

// Click unmute
await hostBrowser.page.click('#toggle-mute');
Expand All @@ -265,10 +265,10 @@ async function runTest() {
'#toggle-mute',
btn => btn.textContent
);
if (unmuteButtonText !== 'Mute') {
throw new Error(`Expected "Mute", got "${unmuteButtonText}"`);
if (unmuteButtonText !== '静音') {
throw new Error(`Expected "静音", got "${unmuteButtonText}"`);
}
console.log('✅ Unmute toggle working (text changed to "Mute")\n');
console.log('✅ Unmute toggle working (text changed to "静音")\n');

// ===== Test 5: End Session =====
console.log('--- Test 5: End Session ---');
Expand Down
6 changes: 3 additions & 3 deletions web/css/studio.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
--meter-ghost: rgba(255,255,255,0.03);

/* TYPOGRAPHY */
--font-display: 'Space Grotesk', system-ui, sans-serif;
--font-body: 'Inter', system-ui, sans-serif;
--font-display: 'Space Grotesk', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
--font-body: 'Inter', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
--font-mono: 'JetBrains Mono', monospace;

--text-xs: 0.6875rem;
Expand Down Expand Up @@ -319,7 +319,7 @@ main {

/* Empty state */
#participants:empty::after {
content: 'The frequency is clear.';
content: '频率清晰。';
grid-column: 1 / -1;
text-align: center;
font-family: var(--font-display);
Expand Down
Loading