[#42296389] Made tests more strict and added context around a test

Also fixed a warning