Skip to content

Commit

Permalink
Fix None sound display and cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mabe committed Jan 2, 2025
1 parent e9524d0 commit 84c95f9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 53 deletions.
43 changes: 9 additions & 34 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,56 +24,26 @@ on:

jobs:

# Build:
# name: Build Debug APK
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3

# - name: Setup Java
# uses: actions/setup-java@v4
# with:
# distribution: 'zulu'
# java-version: '17'
# cache: 'gradle'
# check-latest: true

# - name: Checkout app code
# uses: actions/checkout@v3

# - uses: subosito/flutter-action@v2
# with:
# channel: "stable"

# - run: flutter doctor -v

# - run: flutter pub get

# - name: Build Android Release APK
# run: flutter build apk --debug

# - name: Upload APK Artifact
# uses: actions/upload-artifact@v3
# with:
# name: debug-apk
# path: build/app/outputs/flutter-apk/app-debug.apk

Workout:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Check Version
run: flutter --version

- name: Flutter Doctor
run: flutter doctor -v

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
Expand All @@ -100,18 +70,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Check Version
run: flutter --version

- name: Flutter Doctor
run: flutter doctor -v

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
Expand Down
36 changes: 18 additions & 18 deletions integration_test/timer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ void main() {
await navigateToAddWorkoutOrTimer(tester, false);
await createTimer(tester, timerName);
});
// testWidgets('check timer settings', (tester) async {
// await loadApp(tester);
// await verifyWorkoutOrTimerOpens(tester, timerName);
// await checkWorkoutOrTimer(tester, timerName, 1, false, {
// "10": 2,
// "40": 1,
// "30": 1,
// "90": 1,
// "20": 1,
// "2": 1
// }, {
// "work-sound": "None",
// "rest-sound": "None",
// "halfway-sound": "None",
// "countdown-sound": "None",
// "end-sound": "None",
// });
// });
testWidgets('check timer settings', (tester) async {
await loadApp(tester);
await verifyWorkoutOrTimerOpens(tester, timerName);
await checkWorkoutOrTimer(tester, timerName, 1, false, {
"10": 2,
"40": 1,
"30": 1,
"90": 1,
"20": 1,
"2": 1
}, {
"work-sound": "None",
"rest-sound": "None",
"halfway-sound": "None",
"countdown-sound": "None",
"end-sound": "None",
});
});
testWidgets('run timer and cancel timer', (tester) async {
await loadApp(tester);
await verifyWorkoutOrTimerOpens(tester, timerName);
Expand Down
7 changes: 6 additions & 1 deletion lib/pages/set_sounds/widgets/sound_dropdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class SoundDropdownState extends State<SoundDropdown>

@override
Widget build(BuildContext context) {
String initialSelection;
widget.initialSelection == ""
? initialSelection = "none"
: initialSelection = widget.initialSelection;

return SizedBox(
height: 110,
child: Column(
Expand All @@ -73,7 +78,7 @@ class SoundDropdownState extends State<SoundDropdown>
DropdownMenu<String>(
key: widget.dropdownKey,
width: 240,
initialSelection: widget.initialSelection,
initialSelection: initialSelection,
onSelected: (String? value) {
// This is called when the user selects an item.
widget.onFinished!(value);
Expand Down

0 comments on commit 84c95f9

Please sign in to comment.