Skip to content

Commit 0d79ce5

Browse files
committed
test: Update test fixtures to use johndoe as whoami user
Rename xcuserdata fixture directory from cameroncooke to johndoe and update all test expectations to match the current fixture data including the correct simulator UUID.
1 parent c573c4f commit 0d79ce5

3 files changed

Lines changed: 25 additions & 25 deletions

File tree

src/mcp/tools/xcode-ide/__tests__/sync_xcode_defaults.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { schema, syncXcodeDefaultsLogic } from '../sync_xcode_defaults.ts';
99
const EXAMPLE_PROJECT_PATH = join(process.cwd(), 'example_projects/iOS/MCPTest.xcodeproj');
1010
const EXAMPLE_XCUSERSTATE = join(
1111
EXAMPLE_PROJECT_PATH,
12-
'project.xcworkspace/xcuserdata/cameroncooke.xcuserdatad/UserInterfaceState.xcuserstate',
12+
'project.xcworkspace/xcuserdata/johndoe.xcuserdatad/UserInterfaceState.xcuserstate',
1313
);
1414

1515
describe('sync_xcode_defaults tool', () => {
@@ -59,14 +59,14 @@ describe('sync_xcode_defaults tool', () => {
5959
async () => {
6060
const simctlOutput = JSON.stringify({
6161
devices: {
62-
'com.apple.CoreSimulator.SimRuntime.iOS-18-0': [
63-
{ udid: 'CE3C0D03-8F60-497A-A3B9-6A80BA997FC2', name: 'Apple Vision Pro' },
62+
'com.apple.CoreSimulator.SimRuntime.xrOS-2-0': [
63+
{ udid: 'B38FE93D-578B-454B-BE9A-C6FA0CE5F096', name: 'Apple Vision Pro' },
6464
],
6565
},
6666
});
6767

6868
const executor = createCommandMatchingMockExecutor({
69-
whoami: { output: 'cameroncooke\n' },
69+
whoami: { output: 'johndoe\n' },
7070
find: { output: `${EXAMPLE_PROJECT_PATH}\n` },
7171
stat: { output: '1704067200\n' },
7272
'xcrun simctl': { output: simctlOutput },
@@ -82,14 +82,14 @@ describe('sync_xcode_defaults tool', () => {
8282
expect(result.content[0].text).toContain('Synced session defaults from Xcode IDE');
8383
expect(result.content[0].text).toContain('Scheme: MCPTest');
8484
expect(result.content[0].text).toContain(
85-
'Simulator ID: CE3C0D03-8F60-497A-A3B9-6A80BA997FC2',
85+
'Simulator ID: B38FE93D-578B-454B-BE9A-C6FA0CE5F096',
8686
);
8787
expect(result.content[0].text).toContain('Simulator Name: Apple Vision Pro');
8888
expect(result.content[0].text).toContain('Bundle ID: com.example.MCPTest');
8989

9090
const defaults = sessionStore.getAll();
9191
expect(defaults.scheme).toBe('MCPTest');
92-
expect(defaults.simulatorId).toBe('CE3C0D03-8F60-497A-A3B9-6A80BA997FC2');
92+
expect(defaults.simulatorId).toBe('B38FE93D-578B-454B-BE9A-C6FA0CE5F096');
9393
expect(defaults.simulatorName).toBe('Apple Vision Pro');
9494
expect(defaults.bundleId).toBe('com.example.MCPTest');
9595
},
@@ -98,14 +98,14 @@ describe('sync_xcode_defaults tool', () => {
9898
it.skipIf(!existsSync(EXAMPLE_XCUSERSTATE))('syncs using configured projectPath', async () => {
9999
const simctlOutput = JSON.stringify({
100100
devices: {
101-
'com.apple.CoreSimulator.SimRuntime.iOS-18-0': [
102-
{ udid: 'CE3C0D03-8F60-497A-A3B9-6A80BA997FC2', name: 'Apple Vision Pro' },
101+
'com.apple.CoreSimulator.SimRuntime.xrOS-2-0': [
102+
{ udid: 'B38FE93D-578B-454B-BE9A-C6FA0CE5F096', name: 'Apple Vision Pro' },
103103
],
104104
},
105105
});
106106

107107
const executor = createCommandMatchingMockExecutor({
108-
whoami: { output: 'cameroncooke\n' },
108+
whoami: { output: 'johndoe\n' },
109109
'test -f': { success: true },
110110
'xcrun simctl': { output: simctlOutput },
111111
xcodebuild: { output: ' PRODUCT_BUNDLE_IDENTIFIER = com.example.MCPTest\n' },
@@ -125,7 +125,7 @@ describe('sync_xcode_defaults tool', () => {
125125

126126
const defaults = sessionStore.getAll();
127127
expect(defaults.scheme).toBe('MCPTest');
128-
expect(defaults.simulatorId).toBe('CE3C0D03-8F60-497A-A3B9-6A80BA997FC2');
128+
expect(defaults.simulatorId).toBe('B38FE93D-578B-454B-BE9A-C6FA0CE5F096');
129129
expect(defaults.bundleId).toBe('com.example.MCPTest');
130130
});
131131

@@ -139,14 +139,14 @@ describe('sync_xcode_defaults tool', () => {
139139

140140
const simctlOutput = JSON.stringify({
141141
devices: {
142-
'com.apple.CoreSimulator.SimRuntime.iOS-18-0': [
143-
{ udid: 'CE3C0D03-8F60-497A-A3B9-6A80BA997FC2', name: 'Apple Vision Pro' },
142+
'com.apple.CoreSimulator.SimRuntime.xrOS-2-0': [
143+
{ udid: 'B38FE93D-578B-454B-BE9A-C6FA0CE5F096', name: 'Apple Vision Pro' },
144144
],
145145
},
146146
});
147147

148148
const executor = createCommandMatchingMockExecutor({
149-
whoami: { output: 'cameroncooke\n' },
149+
whoami: { output: 'johndoe\n' },
150150
find: { output: `${EXAMPLE_PROJECT_PATH}\n` },
151151
stat: { output: '1704067200\n' },
152152
'xcrun simctl': { output: simctlOutput },
@@ -162,7 +162,7 @@ describe('sync_xcode_defaults tool', () => {
162162

163163
const defaults = sessionStore.getAll();
164164
expect(defaults.scheme).toBe('MCPTest');
165-
expect(defaults.simulatorId).toBe('CE3C0D03-8F60-497A-A3B9-6A80BA997FC2');
165+
expect(defaults.simulatorId).toBe('B38FE93D-578B-454B-BE9A-C6FA0CE5F096');
166166
expect(defaults.simulatorName).toBe('Apple Vision Pro');
167167
expect(defaults.bundleId).toBe('com.example.MCPTest');
168168
// Original projectPath should be preserved

src/utils/__tests__/nskeyedarchiver-parser.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import {
1212
// Path to the example project's xcuserstate (used as test fixture)
1313
const EXAMPLE_PROJECT_XCUSERSTATE = join(
1414
process.cwd(),
15-
'example_projects/iOS/MCPTest.xcodeproj/project.xcworkspace/xcuserdata/cameroncooke.xcuserdatad/UserInterfaceState.xcuserstate',
15+
'example_projects/iOS/MCPTest.xcodeproj/project.xcworkspace/xcuserdata/johndoe.xcuserdatad/UserInterfaceState.xcuserstate',
1616
);
1717

1818
// Expected values for the MCPTest example project
1919
const EXPECTED_MCPTEST = {
2020
scheme: 'MCPTest',
21-
simulatorId: 'CE3C0D03-8F60-497A-A3B9-6A80BA997FC2',
21+
simulatorId: 'B38FE93D-578B-454B-BE9A-C6FA0CE5F096',
2222
simulatorPlatform: 'iphonesimulator',
2323
};
2424

src/utils/__tests__/xcode-state-reader.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { createCommandMatchingMockExecutor } from '../../test-utils/mock-executo
1212
const EXAMPLE_PROJECT_PATH = join(process.cwd(), 'example_projects/iOS/MCPTest.xcodeproj');
1313
const EXAMPLE_XCUSERSTATE = join(
1414
EXAMPLE_PROJECT_PATH,
15-
'project.xcworkspace/xcuserdata/cameroncooke.xcuserdatad/UserInterfaceState.xcuserstate',
15+
'project.xcworkspace/xcuserdata/johndoe.xcuserdatad/UserInterfaceState.xcuserstate',
1616
);
1717

1818
describe('findXcodeStateFile', () => {
@@ -236,15 +236,15 @@ describe('readXcodeIdeState integration', () => {
236236
async () => {
237237
// Mock executor that returns real paths
238238
const executor = createCommandMatchingMockExecutor({
239-
whoami: { output: 'cameroncooke\n' },
239+
whoami: { output: 'johndoe\n' },
240240
find: { output: `${EXAMPLE_PROJECT_PATH}\n` },
241241
stat: { output: '1704067200\n' },
242242
'xcrun simctl': {
243243
output: JSON.stringify({
244244
devices: {
245-
'com.apple.CoreSimulator.SimRuntime.iOS-18-0': [
245+
'com.apple.CoreSimulator.SimRuntime.xrOS-2-0': [
246246
{
247-
udid: 'CE3C0D03-8F60-497A-A3B9-6A80BA997FC2',
247+
udid: 'B38FE93D-578B-454B-BE9A-C6FA0CE5F096',
248248
name: 'Apple Vision Pro',
249249
},
250250
],
@@ -260,7 +260,7 @@ describe('readXcodeIdeState integration', () => {
260260

261261
expect(result.error).toBeUndefined();
262262
expect(result.scheme).toBe('MCPTest');
263-
expect(result.simulatorId).toBe('CE3C0D03-8F60-497A-A3B9-6A80BA997FC2');
263+
expect(result.simulatorId).toBe('B38FE93D-578B-454B-BE9A-C6FA0CE5F096');
264264
expect(result.simulatorName).toBe('Apple Vision Pro');
265265
},
266266
);
@@ -269,14 +269,14 @@ describe('readXcodeIdeState integration', () => {
269269
'reads scheme using configured projectPath',
270270
async () => {
271271
const executor = createCommandMatchingMockExecutor({
272-
whoami: { output: 'cameroncooke\n' },
272+
whoami: { output: 'johndoe\n' },
273273
'test -f': { success: true },
274274
'xcrun simctl': {
275275
output: JSON.stringify({
276276
devices: {
277-
'com.apple.CoreSimulator.SimRuntime.iOS-18-0': [
277+
'com.apple.CoreSimulator.SimRuntime.xrOS-2-0': [
278278
{
279-
udid: 'CE3C0D03-8F60-497A-A3B9-6A80BA997FC2',
279+
udid: 'B38FE93D-578B-454B-BE9A-C6FA0CE5F096',
280280
name: 'Apple Vision Pro',
281281
},
282282
],
@@ -293,7 +293,7 @@ describe('readXcodeIdeState integration', () => {
293293

294294
expect(result.error).toBeUndefined();
295295
expect(result.scheme).toBe('MCPTest');
296-
expect(result.simulatorId).toBe('CE3C0D03-8F60-497A-A3B9-6A80BA997FC2');
296+
expect(result.simulatorId).toBe('B38FE93D-578B-454B-BE9A-C6FA0CE5F096');
297297
},
298298
);
299299
});

0 commit comments

Comments
 (0)