Skip to content

Commit

Permalink
Merge pull request #199 from DroidKaigi/takahirom/update-readme/2023-…
Browse files Browse the repository at this point in the history
…06-25

Fix README
  • Loading branch information
takahirom authored Jun 25, 2023
2 parents 9bf0703 + 35d10ff commit 94b196d
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ sessions

### Dependency rule

Basically, the dependency rule is as follows:
The basic dependency rule is as follows:

```
Screen -> Section -> Component
```

For example, `TimetableScreen` depends on `TimetableContent` and `TimetableListItem`.
Also, Section can depend on other Sections and components can depend on other components.
For example, `TimetableScreen` depends on `TimetableContent` and `TimetableListItem`.
Also, a Section can depend on other Sections, and components can depend on other components.

### Screen

Expand Down Expand Up @@ -139,7 +139,7 @@ We continue to use Renovate to update dependencies. [./.github/workflows/Renovat

## Overview of the architecture

![architecture diagram](https://github.com/DroidKaigi/conference-app-2023/assets/1386930/c9d8ff0f-0f2e-44a5-9631-c785d1565255)
![architecture diagram](https://github.com/DroidKaigi/conference-app-2023/assets/1386930/03582926-5ff6-4375-87b1-3ec91efb120d)


## Single Source of Truth with buildUiState() {}
Expand All @@ -150,13 +150,17 @@ By working with StateFlow objects, the function can also compute initial values,
Here's an example of using the buildUiState() function:

```kotlin
private val filterUiState: StateFlow<FilterUiState> = buildUiState(
private val timetableContentUiState: StateFlow<TimetableContentUiState> = buildUiState(
sessionsStateFlow,
filtersStateFlow
) { sessions, filters ->
FilterUiState(
enabled = sessions.sessions.isNotEmpty(),
isChecked = filters.filterFavorites
filtersStateFlow,
) { sessionTimetable, filters ->
if (sessionTimetable.timetableItems.isEmpty()) {
return@buildUiState TimetableContentUiState.Empty
}
TimetableContentUiState.ListTimetable(
TimetableListUiState(
timetable = sessionTimetable.filtered(filters),
),
)
}
```
Expand All @@ -169,7 +173,7 @@ Testing an app involves balancing fidelity, how closely the test resembles actua

### Screenshot Testing with Robolectric Native Graphics (RNG) and Roborazzi

Robolectric Native Graphics (RNG) allows us to take app screenshots without needing an emulator or a device. This approach is faster and more reliable than taking device screenshots. While device screenshots may replicate real-world usage slightly more accurately, we believe the benefits of RNG's speed and reliability outweigh this.
[Robolectric Native Graphics (RNG)](https://github.com/robolectric/robolectric/releases/tag/robolectric-4.10) allows us to take app screenshots without needing an emulator or a device. This approach is faster and more reliable than taking device screenshots. While device screenshots may replicate real-world usage slightly more accurately, we believe the benefits of RNG's speed and reliability outweigh this.
We use Roborazzi to compare the current app's screenshots to the old ones, allowing us to spot and fix any visual changes.

### What to test: Balancing Screenshot Tests and Assertion Tests
Expand Down

0 comments on commit 94b196d

Please sign in to comment.