Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: datepicker error fixed #424

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SGI-CAPP-AT2
Copy link
Contributor

Description

The time in addtask was being stored as UTC Time and datepicker using it as datetime(local) which was letting date to go in past. Which occured assertion error when date picker was being shown again. because date was in past and first date was todays.

Fixes #422

Additionally Disabled adding task if time selected is in past

Screenshots

bug_fix_for_dtpickers.mp4

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

The time in addtask was being stored as UTC Time and datepicker using it as datetime(local) which was letting date to go in past.
Which occured assertion error when date picker was being shown again. because date was in past and first date was todays.
@rohansen856
Copy link
Contributor

@SGI-CAPP-AT2 can you run flutter test locally and give me the results, as the tests seem to be passing for me locally...

@SGI-CAPP-AT2
Copy link
Contributor Author

@rohansen856 Yep, I ran those tests
Make sure main branch is synced with origin(which is your fork)
also before that sync your forks main branch with this repos main

00:59 +64 -1: D:/ccextractor/taskwarrior_flutter/test/taskfunctions/datetime_differences_test.dart: DateTime Functions Tests Test when function [E]
  Expected: contains '1mo'
    Actual: '2mo '
     Which: does not contain '1mo'

  package:matcher                                         expect
  package:flutter_test/src/widget_tester.dart 480:18      expect
  test\taskfunctions\datetime_differences_test.dart 43:7  main.<fn>.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/taskfunctions/datetime_differences_test.dart -p vm --plain-name "DateTime Functions Tests Test when function"
01:56 +157 -2: D:/ccextractor/taskwarrior_flutter/test/utils/language/bengali_sentences_test.dart: should provide correct Bengali translations [E]
  Expected: 'TaskWarrior সিঙ্কিং CCSync বা Taskchampion সিঙ্ক সার্ভারে পরিবর্তন করুন'
    Actual: 'Taskwarrior সিঙ্কিং CCSync বা Taskchampion সিঙ্ক সার্ভারে পরিবর্তন করুন'
     Which: is different.
            Expected: TaskWarrior সি ...
              Actual: Taskwarrior সি ...
                          ^
             Differ at offset 4

  package:matcher                                        expect
  package:flutter_test/src/widget_tester.dart 480:18     expect
  test\utils\language\bengali_sentences_test.dart 106:5  main.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/utils/language/bengali_sentences_test.dart -p vm --plain-name "should provide correct Bengali translations"
01:58 +157 -3: D:/ccextractor/taskwarrior_flutter/test/utils/language/english_sentences_test.dart: should provide correct English translations [E]
  Expected: 'Select the directory where the TaskWarrior data is stored\n'
              'Current directory: '
    Actual: 'Select the directory where the Taskwarrior data is stored\n'
              'Current directory: '
     Which: is different.
            Expected: ... e the TaskWarrior da ...
              Actual: ... e the Taskwarrior da ...
                                    ^
             Differ at offset 35

  package:matcher                                       expect
  package:flutter_test/src/widget_tester.dart 480:18    expect
  test\utils\language\english_sentences_test.dart 46:5  main.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/utils/language/english_sentences_test.dart -p vm --plain-name "should provide correct English translations"
02:00 +158 -4: D:/ccextractor/taskwarrior_flutter/test/utils/language/french_sentences_test.dart: should provide correct French translations [E]
  Expected: 'Choisissez le répertoire où les données TaskWarrior sont stockées\n'
              'Répertoire actuel : '
    Actual: 'Choisissez le répertoire où les données Taskwarrior sont stockées\n'
              'Répertoire actuel : '
     Which: is different.
            Expected: ... nnées TaskWarrior so ...
              Actual: ... nnées Taskwarrior so ...
                                    ^
             Differ at offset 44

  package:matcher                                      expect
  package:flutter_test/src/widget_tester.dart 480:18   expect
  test\utils\language\french_sentences_test.dart 48:5  main.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/utils/language/french_sentences_test.dart -p vm --plain-name "should provide correct French translations"
02:02 +158 -5: D:/ccextractor/taskwarrior_flutter/test/utils/language/hindi_sentences_test.dart: should provide correct Hindi translations [E]
  Expected: 'निर्देशिका चुनें जहां TaskWarrior डेटा स्टोर होता है\n'
              'वर्तमान निर्देशिका: '
    Actual: 'निर्देशिका चुनें जहां Taskwarrior डेटा स्टोर होता है\n'
              'वर्तमान निर्देशिका: '
     Which: is different.
            Expected: ...  जहां TaskWarrior डे ...
              Actual: ...  जहां Taskwarrior डे ...
                                    ^
             Differ at offset 26

  package:matcher                                     expect
  package:flutter_test/src/widget_tester.dart 480:18  expect
  test\utils\language\hindi_sentences_test.dart 48:5  main.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/utils/language/hindi_sentences_test.dart -p vm --plain-name "should provide correct Hindi translations"
02:04 +158 -6: D:/ccextractor/taskwarrior_flutter/test/utils/language/marathi_sentences_test.dart: should provide correct Marathi translations [E]
  Expected: 'निर्देशिका निवडा जिथे TaskWarrior डेटा स्टोर केला जातो\n'
              'वर्तमान निर्देशिका: '
    Actual: 'निर्देशिका निवडा जिथे Taskwarrior डेटा स्टोर केला जातो\n'
              'वर्तमान निर्देशिका: '
     Which: is different.
            Expected: ...  जिथे TaskWarrior डे ...
              Actual: ...  जिथे Taskwarrior डे ...
                                    ^
             Differ at offset 26

  package:matcher                                       expect
  package:flutter_test/src/widget_tester.dart 480:18    expect
  test\utils\language\marathi_sentences_test.dart 47:5  main.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/utils/language/marathi_sentences_test.dart -p vm --plain-name "should provide correct Marathi translations"
02:12 +170 -7: D:/ccextractor/taskwarrior_flutter/test/utils/language/spanish_sentences_test.dart: should provide correct Spanish translations [E]
  Expected: 'Selecciona el directorio donde se almacenan los datos de TaskWarrior\n'
              'Directorio actual: '
    Actual: 'Selecciona el directorio donde se almacenan los datos de Taskwarrior\n'
              'Directorio actual: '
     Which: is different.
            Expected: ... os de TaskWarrior\nD ...
              Actual: ... os de Taskwarrior\nD ...
                                    ^
             Differ at offset 61

  package:matcher                                       expect
  package:flutter_test/src/widget_tester.dart 480:18    expect
  test\utils\language\spanish_sentences_test.dart 50:5  main.<fn>

@rohansen856
Copy link
Contributor

@rohansen856 Yep, I ran those tests Make sure main branch is synced with origin(which is your fork) also before that sync your forks main branch with this repos main

00:59 +64 -1: D:/ccextractor/taskwarrior_flutter/test/taskfunctions/datetime_differences_test.dart: DateTime Functions Tests Test when function [E]
  Expected: contains '1mo'
    Actual: '2mo '
     Which: does not contain '1mo'

  package:matcher                                         expect
  package:flutter_test/src/widget_tester.dart 480:18      expect
  test\taskfunctions\datetime_differences_test.dart 43:7  main.<fn>.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/taskfunctions/datetime_differences_test.dart -p vm --plain-name "DateTime Functions Tests Test when function"
01:56 +157 -2: D:/ccextractor/taskwarrior_flutter/test/utils/language/bengali_sentences_test.dart: should provide correct Bengali translations [E]
  Expected: 'TaskWarrior সিঙ্কিং CCSync বা Taskchampion সিঙ্ক সার্ভারে পরিবর্তন করুন'
    Actual: 'Taskwarrior সিঙ্কিং CCSync বা Taskchampion সিঙ্ক সার্ভারে পরিবর্তন করুন'
     Which: is different.
            Expected: TaskWarrior সি ...
              Actual: Taskwarrior সি ...
                          ^
             Differ at offset 4

  package:matcher                                        expect
  package:flutter_test/src/widget_tester.dart 480:18     expect
  test\utils\language\bengali_sentences_test.dart 106:5  main.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/utils/language/bengali_sentences_test.dart -p vm --plain-name "should provide correct Bengali translations"
01:58 +157 -3: D:/ccextractor/taskwarrior_flutter/test/utils/language/english_sentences_test.dart: should provide correct English translations [E]
  Expected: 'Select the directory where the TaskWarrior data is stored\n'
              'Current directory: '
    Actual: 'Select the directory where the Taskwarrior data is stored\n'
              'Current directory: '
     Which: is different.
            Expected: ... e the TaskWarrior da ...
              Actual: ... e the Taskwarrior da ...
                                    ^
             Differ at offset 35

  package:matcher                                       expect
  package:flutter_test/src/widget_tester.dart 480:18    expect
  test\utils\language\english_sentences_test.dart 46:5  main.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/utils/language/english_sentences_test.dart -p vm --plain-name "should provide correct English translations"
02:00 +158 -4: D:/ccextractor/taskwarrior_flutter/test/utils/language/french_sentences_test.dart: should provide correct French translations [E]
  Expected: 'Choisissez le répertoire où les données TaskWarrior sont stockées\n'
              'Répertoire actuel : '
    Actual: 'Choisissez le répertoire où les données Taskwarrior sont stockées\n'
              'Répertoire actuel : '
     Which: is different.
            Expected: ... nnées TaskWarrior so ...
              Actual: ... nnées Taskwarrior so ...
                                    ^
             Differ at offset 44

  package:matcher                                      expect
  package:flutter_test/src/widget_tester.dart 480:18   expect
  test\utils\language\french_sentences_test.dart 48:5  main.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/utils/language/french_sentences_test.dart -p vm --plain-name "should provide correct French translations"
02:02 +158 -5: D:/ccextractor/taskwarrior_flutter/test/utils/language/hindi_sentences_test.dart: should provide correct Hindi translations [E]
  Expected: 'निर्देशिका चुनें जहां TaskWarrior डेटा स्टोर होता है\n'
              'वर्तमान निर्देशिका: '
    Actual: 'निर्देशिका चुनें जहां Taskwarrior डेटा स्टोर होता है\n'
              'वर्तमान निर्देशिका: '
     Which: is different.
            Expected: ...  जहां TaskWarrior डे ...
              Actual: ...  जहां Taskwarrior डे ...
                                    ^
             Differ at offset 26

  package:matcher                                     expect
  package:flutter_test/src/widget_tester.dart 480:18  expect
  test\utils\language\hindi_sentences_test.dart 48:5  main.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/utils/language/hindi_sentences_test.dart -p vm --plain-name "should provide correct Hindi translations"
02:04 +158 -6: D:/ccextractor/taskwarrior_flutter/test/utils/language/marathi_sentences_test.dart: should provide correct Marathi translations [E]
  Expected: 'निर्देशिका निवडा जिथे TaskWarrior डेटा स्टोर केला जातो\n'
              'वर्तमान निर्देशिका: '
    Actual: 'निर्देशिका निवडा जिथे Taskwarrior डेटा स्टोर केला जातो\n'
              'वर्तमान निर्देशिका: '
     Which: is different.
            Expected: ...  जिथे TaskWarrior डे ...
              Actual: ...  जिथे Taskwarrior डे ...
                                    ^
             Differ at offset 26

  package:matcher                                       expect
  package:flutter_test/src/widget_tester.dart 480:18    expect
  test\utils\language\marathi_sentences_test.dart 47:5  main.<fn>


To run this test again: C:\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe test D:/ccextractor/taskwarrior_flutter/test/utils/language/marathi_sentences_test.dart -p vm --plain-name "should provide correct Marathi translations"
02:12 +170 -7: D:/ccextractor/taskwarrior_flutter/test/utils/language/spanish_sentences_test.dart: should provide correct Spanish translations [E]
  Expected: 'Selecciona el directorio donde se almacenan los datos de TaskWarrior\n'
              'Directorio actual: '
    Actual: 'Selecciona el directorio donde se almacenan los datos de Taskwarrior\n'
              'Directorio actual: '
     Which: is different.
            Expected: ... os de TaskWarrior\nD ...
              Actual: ... os de Taskwarrior\nD ...
                                    ^
             Differ at offset 61

  package:matcher                                       expect
  package:flutter_test/src/widget_tester.dart 480:18    expect
  test\utils\language\spanish_sentences_test.dart 50:5  main.<fn>

thanks @SGI-CAPP-AT2 will update the tests and push shortly!

@SGI-CAPP-AT2
Copy link
Contributor Author

Hey @rohansen856, if you're not working on the test issue, can I work on it?

@rohansen856
Copy link
Contributor

Hey @rohansen856, if you're not working on the test issue, can I work on it?

I am currently working on the test issue... you can follow the discussion in the issue #389 as there is a matter with the sqlite database testing... Any suggestion would help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date picker not working
2 participants