Skip to content
Merged

canary #5707

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
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ android {
dimension "environment"
applicationId "me.tinykitten.trainlcd.dev"
versionNameSuffix "-dev"
versionCode 100000352
versionCode 100000353
versionName "10.3.1"
}
prod {
dimension "environment"
versionCode 100000352
versionCode 100000353
versionName "10.3.1"
}
}
Expand Down
5 changes: 3 additions & 2 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default ({ config }: ConfigContext) => ({
},
},
ios: {
buildNumber: '2565',
buildNumber: '2566',
bundleIdentifier:
process.env.EAS_BUILD_PROFILE === 'production'
? 'me.tinykitten.trainlcd'
Expand All @@ -70,7 +70,7 @@ export default ({ config }: ConfigContext) => ({
? 'me.tinykitten.trainlcd'
: 'me.tinykitten.trainlcd.dev',
permissions: [],
versionCode: 100000352,
versionCode: 100000353,
},
owner: 'trainlcd',
});
Expand Down Expand Up @@ -128,5 +128,6 @@ export default ({ config }: ConfigContext) => ({






36 changes: 18 additions & 18 deletions ios/TrainLCD.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2419,7 +2419,7 @@
CODE_SIGN_ENTITLEMENTS = ProdTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Prod/Info.plist;
Expand Down Expand Up @@ -2458,7 +2458,7 @@
CODE_SIGN_ENTITLEMENTS = ProdTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Prod/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = TrainLCD;
Expand Down Expand Up @@ -2517,7 +2517,7 @@
CODE_SIGN_ENTITLEMENTS = TrainLCD/trainlcd.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -2623,7 +2623,7 @@
CODE_SIGN_ENTITLEMENTS = TrainLCD/trainlcd.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -2702,7 +2702,7 @@
CODE_SIGN_ENTITLEMENTS = CanaryTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Dev/Info.plist;
Expand Down Expand Up @@ -2741,7 +2741,7 @@
CODE_SIGN_ENTITLEMENTS = CanaryTrainLCD.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
INFOPLIST_FILE = TrainLCD/Schemes/Dev/Info.plist;
Expand Down Expand Up @@ -2952,7 +2952,7 @@
CODE_SIGN_ENTITLEMENTS = RideSessionActivity/CanaryRideSessionActivity.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -3003,7 +3003,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -3054,7 +3054,7 @@
CODE_SIGN_ENTITLEMENTS = WatchWidget/ProdWatchWidget.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3112,7 +3112,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3163,7 +3163,7 @@
CODE_SIGN_ENTITLEMENTS = WatchWidget/CanaryWatchWidget.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3220,7 +3220,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -3268,7 +3268,7 @@
CODE_SIGN_ENTITLEMENTS = RideSessionActivity/ProdRideSessionActivity.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -3319,7 +3319,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -3538,7 +3538,7 @@
CODE_SIGN_ENTITLEMENTS = ProdAppClip/ProdAppClip.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down Expand Up @@ -3594,7 +3594,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down Expand Up @@ -3644,7 +3644,7 @@
CODE_SIGN_ENTITLEMENTS = CanaryAppClip/CanaryAppClip.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down Expand Up @@ -3702,7 +3702,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2565;
CURRENT_PROJECT_VERSION = 2566;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = E6R2G33Z36;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand Down
162 changes: 162 additions & 0 deletions src/components/TypeChangeNotify.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ jest.mock('./BarTerminalEast', () => ({
BarTerminalEast: jest.fn(() => null),
}));

jest.mock('./BarTerminalOdakyu', () => ({
BarTerminalOdakyu: jest.fn(() => null),
}));

jest.mock('./BarTerminalSaikyo', () => ({
BarTerminalSaikyo: jest.fn(() => null),
}));
Expand Down Expand Up @@ -149,4 +153,162 @@ describe('TypeChangeNotify', () => {
render(<TypeChangeNotify />);
}).not.toThrow();
});

it('ODAKYUテーマでクラッシュしない', () => {
const { useAtomValue } = require('jotai');
useAtomValue.mockImplementation((atom: unknown) => {
if (atom === require('../store/atoms/station').default) {
return {
selectedDirection: 'INBOUND',
stations: [],
selectedBound: null,
};
}
if (atom === require('../store/atoms/theme').themeAtom) {
return 'ODAKYU';
}
return {};
});

expect(() => {
render(<TypeChangeNotify />);
}).not.toThrow();
});

it('直通運転時に中間路線名が正しく表示される(小田急多摩線→千代田線→常磐線)', () => {
const { useAtomValue } = require('jotai');
const {
useCurrentLine,
useCurrentStation,
useCurrentTrainType,
useNextTrainType,
} = require('~/hooks');

const odakyuTamaLine = {
id: 100,
nameShort: '小田急多摩線',
nameRoman: 'Odakyu Tama Line',
color: '#0D82C7',
};

const chiyodaLine = {
id: 200,
nameShort: '千代田線',
nameRoman: 'Chiyoda Line',
color: '#009944',
};

const jobanLine = {
id: 300,
nameShort: '常磐線',
nameRoman: 'Joban Line',
color: '#00B264',
};

// 直通運転時、station.lineは全て選択路線(小田急多摩線)になるが、
// station.linesには実際の路線が含まれる
const stations = [
{
id: 1,
groupId: 1,
name: '新百合ヶ丘',
nameRoman: 'Shin-Yurigaoka',
line: odakyuTamaLine,
lines: [odakyuTamaLine],
trainType: { typeId: 1, name: '急行', nameRoman: 'Express' },
stopCondition: 'STOP',
},
{
id: 2,
groupId: 2,
name: '代々木上原',
nameRoman: 'Yoyogi-Uehara',
line: odakyuTamaLine,
lines: [odakyuTamaLine, chiyodaLine],
trainType: { typeId: 2, name: '準急', nameRoman: 'Semi Express' },
stopCondition: 'STOP',
},
{
id: 3,
groupId: 3,
name: '表参道',
nameRoman: 'Omote-sando',
line: odakyuTamaLine,
lines: [chiyodaLine],
trainType: { typeId: 2, name: '準急', nameRoman: 'Semi Express' },
stopCondition: 'STOP',
},
{
id: 4,
groupId: 4,
name: '綾瀬',
nameRoman: 'Ayase',
line: odakyuTamaLine,
lines: [chiyodaLine, jobanLine],
trainType: { typeId: 2, name: '準急', nameRoman: 'Semi Express' },
stopCondition: 'STOP',
},
{
id: 5,
groupId: 4,
name: '綾瀬',
nameRoman: 'Ayase',
line: jobanLine,
lines: [chiyodaLine, jobanLine],
trainType: { typeId: 3, name: '各停', nameRoman: 'Local' },
stopCondition: 'STOP',
},
{
id: 6,
groupId: 5,
name: '取手',
nameRoman: 'Toride',
line: jobanLine,
lines: [jobanLine],
trainType: { typeId: 3, name: '各停', nameRoman: 'Local' },
stopCondition: 'STOP',
},
];

useCurrentLine.mockReturnValue(odakyuTamaLine);
useCurrentStation.mockReturnValue(stations[3]);
useCurrentTrainType.mockReturnValue({
typeId: 2,
name: '準急',
nameRoman: 'Semi Express',
color: '#009944',
line: odakyuTamaLine,
});
useNextTrainType.mockReturnValue({
typeId: 3,
name: '各停',
nameRoman: 'Local',
color: '#00B264',
line: jobanLine,
});

useAtomValue.mockImplementation((atom: unknown) => {
if (atom === require('../store/atoms/station').default) {
return {
selectedDirection: 'INBOUND',
stations,
selectedBound: { name: '取手', nameRoman: 'Toride' },
};
}
if (atom === require('../store/atoms/theme').themeAtom) {
return 'TOKYO_METRO';
}
return {};
});

const { queryAllByText } = render(<TypeChangeNotify />);

// 左側のバーの路線名が千代田線(中間路線)であること
// 小田急多摩線(選択路線)ではないこと
const chiyodaTexts = queryAllByText(/千代田線/);
expect(chiyodaTexts.length).toBeGreaterThan(0);

const odakyuTexts = queryAllByText(/小田急多摩線/);
expect(odakyuTexts).toHaveLength(0);
});
});
Loading
Loading