Babel Conflicts

This week, I began resolving dependency issues in order to rerun all test files and create new tests. There were several conflicts, so I reinstalled all jest and babel dependencies to address them. And this resulted in another failure to render the application due to Babel’s configuration and plugins.

The Error message was unclear, the code was difficult to follow.  This caused me to have greater difficulty troubleshooting the problem and discovering the bug, and it took me a significant amount of time to find a solution. I eventually had to separate the babel configurations for the application and the test files.

After that, I began to examine the test files and ensure that they ran properly. Numerous issues relating to Fake-timers and Mocks have appeared; I must solve them, ensure that existing tests are functional, and create new tests with no dependency conflicts or incorrect configurations.

Stuck in the Dependency Hell

This week, I was tasked with doing some test tasks, however, in order to complete them, I had to update a number of dependencies, which resulted in a large number of dependency conflicts.

My supervisor gave me the go-ahead to upgrade all dependencies and the react native version to the most recent version. It is not uncommon to discover several problems in the code and some dependency conflicts after getting done from the updates, which eventually I was able to resolve. Moreover, to modify the code and fix the errors, I had to spend some time reading the documentation for the new versions that I had upgraded.

Finally, with Mr. Peter’s assistance, the application ran properly on the emulator. Unfortunately, the testing dependencies still contain some errors, and Jest is unable to test the application. I have attempted a variety of solutions to resolve this issue, which will be resolved by next week.

In conclusion, this week was filled with dependencies updates and bug debugging. I’ve gained a lot of knowledge about how to handle the dependency conflict through much searching and reading, and from Mr. Peter of course. Now I must resolve the rest of the issues in the testing section so everything can be updated and work well.

First Testing Task

This week I started my first project-based technical task. I worked on writing a test file of a Pick function for the mobile app. During the process of testing I explored and searched for the following practices when performing this task.

I faced multiple hiccups during my search looking for solutions to the difficulties I had encountered during implementing an integration test. One of the problems I needed to handle is testing a function that uses an API, upon searching for solutions, I learned more about mocking and the way it works by isolating and only focusing on the code under test and sending the data without interacting with the API. Mr. Peter was a great mentor and helped me A LOT to get the job done.

The quality of the code I had at hand was not optimal and caused a lot of issues that I met when I was trying to test the code. In an effort to solve this, I learned how to debug the code by using the breakpoints points in Visual Studio Code which enable me to follow the sequence of the coding lines and give me the ability to pause the debugging process in order to check variables states and current value.

In conclusion, this week was full of learning and testing. I learned a lot during this week about testing and the steps that must be followed to do a unit test for a certain function. Learning how to utilize an important tool such as breakpoints was also beneficial and will aid me in my future testing efforts.

Second week at Tong Hin

After I had been familiar with the React Native and Typescript that we use in the current project. Mr. Peter helped me with installing and configuring the environment and the project on the computer. And it took some time because there were so many dependencies involved in the beginning.


Following that, I needed to look into the project files specially the testing  files and understand how that operates in order to carry on the testing later. Therefore, in order to begin learning how to test, you need to have an understanding of the concept of the AAA pattern. And That is how we structure a unit test by dividing each test into three sections — Arrange, Act, and Assert — with each section serving as a prerequisite for the next. The arrange phase puts up the input values for the test. The act phase initiates the primary tested function. And finally, the assert step ensures that the function’s output matches expectations.


After that, I got introduced to react testing library that we can implement a test using jets. Which is a test runner that identifies tests, executes them, and evaluates whether or not they passed or failed. I spent most of my time reading and gaining knowledge about testing, as well as putting several tests into practice.

Last week at Tong Hin

It’s been 25 weeks since I published my first blog.

In the past six months, I’ve learned a lot. I started up knowing nothing about test automation or react native, but after 25 weeks, I can confidently state that I’ve at least grasped the fundamentals of how they function, as well as why TypeScript is significant.

I completed adding decimal text input to the system last week, and I also fixed a fault that prevented an immediate updating of the onChange text. We initially attempted using throttle to resolve the problem, but it didn’t work, so we eventually fixed it by avoiding setting inside the onChange text.

In order to ensure that the decimal text input doesn’t contain any bugs, I also created a test script for it and tried to cover all possible scenarios by creating about 9 different scenarios.

Additionally, I created a test script for the general alert and tested it using a variety of circumstances. It performed flawlessly and without any bugs.

I appreciate Ms. Peter and Tong Hin giving me the chance.
The environment at Tong Hin helps anyone boost their knowledge and has helped me improve myself in many different fields.

My First Week at Tong Hin

My first week at the company was mainly focused on learning the technologies that I’ll be working on during my training. I spent the first day learning and refreshing my knowledge of Git. I learnt how to use Git by commands, creating repository, branches, committing, and how to deal with conflicts if occur.

Next, I dived into react native and react hooks. I managed to install the environment on my computer and I’ve solved few examples presented in the courses I followed.

Finally, I learned about TypeScript which I only heard of before, I learned the basic fundamentals about the programming language and I was introduced by my supervisor about the current project under development and the testing environment adopted to test the efficiency of the software.

Create a Numeric TextInput Component

On the past week, I tried to create a component text input that accept only number or characters that belong to numbers.

The limitation on text input for amount entering was mentioned by Ms. Peter the previous week. Users occasionally misread the characters and digits in the quantity input area.

The issue here is the time wasted on that procedure, not the fact that it will undoubtedly throw an error after publishing the request.

In order to retain the text just including numeric letters, we use regex to filter the input and delete everything that does not belong to numbers. Everything is now fine after creating the component and using regex, but we discovered another issue with the user interface, in which characters that don’t belong to numbers appear on changing text and then are removed. We need to find a solution where the regex function is called back before on changing text, but we haven’t yet defined that issue. I tried some suggestions, like onPressKey, but I still couldn’t figure out how to use it in my situation.

Create an Alert Library

During the previous week, we discovered a flaw in the alert library we use, Awesome Alert.

The user discovered last week that when he locks the device while the alert is promoting and unlocks it again, the alert abruptly vanishes. and that creates a significant issue because the user won’t be able to move on to next function where he must press the approve button because it has a callback function.

After numerous attempts, we determined that the issue is with the library itself, so I tried using a different library, but the same issue was discovered when locking and unlocking the device. As a result, we were unable to find a solution unless we used the default React Native Alert, which has a poor user interface.

I created a new component and attempted to create my own alert using features from the react native paper, such as modal, since the issue was with the react native model. Initially, I created an alert called “Okay” that only had one callback when the user clicked “Okay”, but later, I changed it to a library so that the developer could choose which alert he wanted to use, such as “Confirm” and “Cancel” or “Yes or No”, with their respective callback functions.

Swagger Codegen Bug

I had a wide variety of things last week that I’m going to talk about with you in this post.

So, we begin by fixing the bug in Swagger Codegen that prevents us from changing the parameter of type array to inspected format. Instead of fixing the problem, however, we simply stated that there isn’t one and that it needs to be fixed and changed through the backend because we discovered on Github that they haven’t fixed the bug yet.

Additionally, I had to test the desktop application since we made some changes to it, so before doing so, I updated the database by using some commands, and I then created numerous scenarios to further validate that the application functioned as intended.

The most challenging part is trying to identify the issue that leads to the bug when logging out of the project using ASP.NET. I made the button and intended to call the logout through it, but I still haven’t made it since I’m not too experienced with ASP.NET and Visual Studio, so I got confused trying to grasp how Mr. Peter created the identity server and how he is calling the function. I’m still researching that area, though.

NSwag OpenApi

I figured out how to pick a multi-warehouse last week.

The issue I’ve run into is that when I choose more than one warehouse, the parameter’s format changes to an unexpected format from the API. After much investigation, I’ve determined that this is a bug in Swagger, specifically an Axios bug because I tried to implement it the old way but still experienced the same problem. Although this problem has been raised, it has not yet been resolved. therefore I chose to replace the generator.

I have tested the Nswag generator while searching for a new generator and testing many of them. The Nswag Generator is an openapi generator that uses typescript fetch rather than Axios, unlike the previous generator (swagger Codegen)

I initially struggled to figure out how to use it, but after numerous attempts, I was able to get it to work. However, I had to make numerous changes to the generator itself, which is not recommended because the generator’s intended use is to assist developers in calling APIs. Even so, I was forced to make these changes. The type was originally void. I changed it to Response. It wasn’t returning on the 200 status. I changed it to text, and I changed it to JSON.