Diapolo10 / 5G00EV25-3001_client

The client side of the course communication system project
MIT License
1 stars 1 forks source link

Add unit tests for the desktop client #2

Open Diapolo10 opened 2 years ago

Diapolo10 commented 2 years ago

The desktop client needs its own unit tests. Fortunately, Rust makes this fairly easy. Unfortunately, someone still needs to make them.

We probably don't need to test GUI elements, just the "business logic" of the application, so don't get hung-up on that.

rpjuja commented 2 years ago

I came up with some templates for tests but couldn't figure out how to actually test anything. Is this even how the tests should be done?

In the same file (chatroom.rs) as chatroom component:

Image

And yeah I haven't found a way to test the GUI.

Diapolo10 commented 2 years ago

I think that looks perfectly fine, but I can't really focus on this until I get back from the rehearsal.

GUI testing doesn't really matter, it cannot be unit tested meaningfully. It would require more complex testing, and I don't think we should focus on that.