Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBresson committed Dec 4, 2023
1 parent 20708e0 commit 73bff8a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,28 @@ exports[`LanguageScreen renders correctly 1`] = `
Italiano
</Text.Primary>
</TouchableOpacity>
<TouchableOpacity
onPress={[Function]}
style={
{
"flexDirection": "row",
"justifyContent": "space-between",
}
}
>
<Text.Primary
bold={true}
green={false}
numberOfLines={1}
style={
{
"paddingVertical": 20,
}
}
>
عربي
</Text.Primary>
</TouchableOpacity>
</View>
</RCTScrollView>
</View>
Expand Down
20 changes: 10 additions & 10 deletions app/utils/calculation/__tests__/calculation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,36 +282,36 @@ describe("getDisplayUnitsValue should convert the given kilogram value to", () =
describe("getDisplayUnits should return the correct units given a kilogram value that should be converted to", () => {
it("grams", () => {
for (const kgValue of unitsBasline.toGrams) {
expect(calculation.getDisplayUnits(kgValue, true)).toEqual(t("GRAMS_SYMBOL"));
expect(calculation.getDisplayUnits(kgValue, true, false)).toEqual(t("GRAMS_FULL"));
expect(calculation.getDisplayUnits(kgValue, true)).toEqual(t("CALCULATION_GRAMS_SYMBOL"));
expect(calculation.getDisplayUnits(kgValue, true, false)).toEqual(t("CALCULATION_GRAMS_FULL"));
}
});

it("kilograms", () => {
for (const kgValue of unitsBasline.toKilograms) {
expect(calculation.getDisplayUnits(kgValue, true)).toEqual(t("KILOGRAMS_SYMBOL"));
expect(calculation.getDisplayUnits(kgValue, true, false)).toEqual(t("KILOGRAMS_FULL"));
expect(calculation.getDisplayUnits(kgValue, true)).toEqual(t("CALCULATION_KILOGRAMS_SYMBOL"));
expect(calculation.getDisplayUnits(kgValue, true, false)).toEqual(t("CALCULATION_KILOGRAMS_FULL"));
}
});

it("tonnes", () => {
for (const kgValue of unitsBasline.toTonnes) {
expect(calculation.getDisplayUnits(kgValue, true)).toEqual(t("TONNES_SYMBOL"));
expect(calculation.getDisplayUnits(kgValue, true, false)).toEqual(t("TONNES_FULL"));
expect(calculation.getDisplayUnits(kgValue, true)).toEqual(t("CALCULATION_TONNES_SYMBOL"));
expect(calculation.getDisplayUnits(kgValue, true, false)).toEqual(t("CALCULATION_TONNES_FULL"));
}
});

it("ounces", () => {
for (const kgValue of unitsBasline.toOunces) {
expect(calculation.getDisplayUnits(kgValue, false)).toEqual(t("OUNCES_SYMBOL"));
expect(calculation.getDisplayUnits(kgValue, false, false)).toEqual(t("OUNCES_FULL"));
expect(calculation.getDisplayUnits(kgValue, false)).toEqual(t("CALCULATION_OUNCES_SYMBOL"));
expect(calculation.getDisplayUnits(kgValue, false, false)).toEqual(t("CALCULATION_OUNCES_FULL"));
}
});

it("pounds", () => {
for (const kgValue of unitsBasline.toPounds) {
expect(calculation.getDisplayUnits(kgValue, false)).toEqual(t("POUNDS_SYMBOL"));
expect(calculation.getDisplayUnits(kgValue, false, false)).toEqual(t("POUNDS_FULL"));
expect(calculation.getDisplayUnits(kgValue, false)).toEqual(t("CALCULATION_POUNDS_SYMBOL"));
expect(calculation.getDisplayUnits(kgValue, false, false)).toEqual(t("CALCULATION_POUNDS_FULL"));
}
});
});

0 comments on commit 73bff8a

Please sign in to comment.