Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB2-9558: updated no data available, km and mi translations #94

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ public class CvsOdometerReadingFormatter {

public static final String MILES = "miles";
public static final String MILES_WELSH = "milltiroedd";

private static final String MILES_UNIT = "mi";
public static final String KILOMETERS = "kilometres";
public static final String KILOMETERS_WELSH = "cilometrau";
private static final String KILOMETERS_UNIT = "km";
private static final String THOUSANDS_PATTERN = "\\B(?=(?:.{3})+$)";
private static final String THOUSANDS_SEPARATOR = ",";
Expand Down Expand Up @@ -47,10 +48,12 @@ public String formatWelshValue(CvsOdometerReading odometer) {

private String formatUnit(String unit, Boolean unitWelsh) {
switch (unit) {
case MILES:
case MILES_UNIT:
return unitWelsh.equals(Boolean.TRUE) ? MILES_WELSH : MILES;
case KILOMETERS:
case KILOMETERS_UNIT:
return "km";
return unitWelsh.equals(Boolean.TRUE) ? KILOMETERS_WELSH : KILOMETERS;
default:
return unit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
</ul>
{{else}}
<span class="heading-info__content" id="no_data_message">
No data available
Dim data ar gael
</span>
{{/if}}
<!-- /header__histories -->
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/views/CommercialVehicles/passWelsh.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
</ul>
{{else}}
<span class="heading-info__content" id="no_data_message">
No data available
Dim data ar gael
</span>
{{/if}}
<!-- /header__histories -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void verifyMileage() {
String mileage2 = certificatePageObjectVTG5W.getMileage();

assertEquals(testCertificate.getData().getFormattedCurrentOdometer(), mileage);
assertEquals(testCertificate.getData().getFormattedCurrentOdometer(), mileage2);
assertEquals("20,000 cilometrau", mileage2);
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/htmlverification/tests/VTP20Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void verifyCurrentOdomoter() {
@Test
public void verifyOdomoterHistory() {
String actual = certificatePageObject.getElement("#mileage-history").text();
String expected = "120 km 01.02.2016 330 km 30.01.2017";
String expected = "120 kilometres 01.02.2016 330 kilometres 30.01.2017";
assertEquals(expected, actual);
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/htmlverification/tests/VTP20WTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public void verifyOdometerHistoryMessageWhenNoHistoryExists() {
certificatePageObject = new CertificatePageObject(certHtml);

String actual = certificatePageObject.getElement("#no_data_message").text();
String expected = "No data available";
String expected = "Dim data ar gael";
assertEquals(expected, actual);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class CvsOdometerReadingFormatterTest {
{
"format in kilometers",
new CvsOdometerReading("15012", "km", "01.12.2017"),
"15,012 km"
"15,012 kilometres"
},
{
"format without unit",
Expand Down
Loading