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

There is no test for getImage in pictogram_api.dart #2

Closed
TobiasPalludan opened this issue Mar 13, 2019 · 2 comments · Fixed by #25
Closed

There is no test for getImage in pictogram_api.dart #2

TobiasPalludan opened this issue Mar 13, 2019 · 2 comments · Fixed by #25

Comments

@TobiasPalludan
Copy link
Contributor

Solve following todo.

Observable<Image> getImage(int id) {
    // TODO test this method
    return _http.get('/$id/image/raw').map((Response res) {
      return Image.memory(res.response.bodyBytes);
    });
  }
@boginw
Copy link
Contributor

boginw commented Apr 1, 2019

See this

@TobiasPalludan TobiasPalludan transferred this issue from aau-giraf/weekplanner Apr 2, 2019
@Lortemanden Lortemanden added this to To do in 2020f 1. sprint via automation Mar 9, 2020
@Lortemanden Lortemanden added this to the 2020S1 milestone Mar 9, 2020
@Lortemanden Lortemanden changed the title Write test for getImage in pictogram_api.dart There is no test for getImage in pictogram_api.dart Mar 10, 2020
@jkrod jkrod added the point: 5 label Mar 11, 2020
@Lortemanden Lortemanden moved this from To do to Issues in progress in 2020f 1. sprint Mar 12, 2020
@joandrsn
Copy link
Contributor

I'm starting to understand why this hasn't been done yet.

2 points:
The HTTP Mock library does not support binary files as the real web-api does.
This can be seen here:

final Map<String, dynamic> json;

Further more I'm questioning whether or not it is possible to test the function as it stands today.
Currently it utilises the Image widget class. I cannot find any way of converting from a widget to the raw bytes (In order to test).
As such, I would suggest instead looking into returning an ImageProvider which should be more suitable.

joandrsn added a commit that referenced this issue Mar 19, 2020
@joandrsn joandrsn linked a pull request Mar 20, 2020 that will close this issue
2020f 1. sprint automation moved this from Issues in progress to Issues done Mar 31, 2020
mathiasandresen pushed a commit that referenced this issue Apr 3, 2020
* setting up develop-branch

* delete local.properties which should be ignored

* updated deprecated test code from both dart and the Flutter framework

* local.properties added, which made my tests fail through the Azure Pipelines

* fixed requested changes from @pegede17

* gitignore changed to ignore: Dart, Flutter, Intellij, AndroidStudio, VisualStudioCode

* gitignore changed to ignore: Dart, Flutter, Intellij, AndroidStudio, VisualStudioCode.

Removed:
/android/local.properties
/android/**/GeneratedPluginRegistrant.java
/.flutter-plugins

* deletion of:
/.flutter-plugins
/.pubspec.lock

* Fixes #2

* Edited the role string to correct format

Example;
Before Citizen role would create the string "Role.Citizen".
After Citizen role will create the string "Citizen"

* Fixes #26 - Move CI from Azure to GH Actions (#27)

* Create build-and-test.yml

* Delete azure-pipelines.yml

* removed the build task

* Update build-and-test.yml

* Update and rename build-and-test.yml to lint-and-test.yml

* Update lint-and-test.yml

* Fix 30: Updated comment to clarify confusion about the number of weeks in a year (#31)

* Updated comment to clarify amount of weeks in a year

* Linter update

Co-authored-by: HaxorHurley <33719181+HaxorHurley@users.noreply.github.com>

* Add cast in test

* Rename to imageWidget

* Updated Api-client settings to fit changes on the web-client (#36)

Updated getsettings() & updateSettings in user_api.dart to throw exception if call failed
Added tests in user_api_test.dart for checking when updateSettings() and getSettings() fail.

Co-Authored-By: Ronnie Svendsen <rsvend17@users.noreply.github.com>

Co-authored-by: Ronnie Svendsen <rsvend17@users.noreply.github.com>

* removed as (#40)

Co-authored-by: tdybda17@student.aau.dk <Agk87ekg1997>
Co-authored-by: Tobias Dybdahl <33865716+tdybda17@users.noreply.github.com>
Co-authored-by: Jonas Andersen <jonas@anrsn.me>
Co-authored-by: TobiasNielsen <34129506+TobiasNielsen@users.noreply.github.com>
Co-authored-by: Christian Hurley <christian.hurley00@gmail.com>
Co-authored-by: HaxorHurley <33719181+HaxorHurley@users.noreply.github.com>
Co-authored-by: Laexander <laexander2@gmail.com>
Co-authored-by: Ronnie Svendsen <rsvend17@users.noreply.github.com>
Co-authored-by: Jonas Andersen <jban18@student.aau.dk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
2020f 1. sprint
  
Issues done
Development

Successfully merging a pull request may close this issue.