Skip to content

Commit

Permalink
Fix data consistency so tests work
Browse files Browse the repository at this point in the history
  • Loading branch information
niallthomson committed Jan 18, 2025
1 parent 2c7def5 commit 5925680
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 56 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/ci-assets.yml

This file was deleted.

6 changes: 4 additions & 2 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ jobs:
shell: devenv shell bash -- -e {0}
run: |
MYSQL_PASSWORD='test123' yarn nx compose:up
sleep 60
MYSQL_PASSWORD='test123' yarn nx compose:up
CYPRESS_BASE_URL='http://localhost:8888' yarn nx test e2e
MYSQL_PASSWORD='test123' yarn nx compose:down
kubernetes:
name: Kubernetes E2E Tests
Expand Down
4 changes: 2 additions & 2 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"cwd": "{projectRoot}"
}
},

"serve": {
"executor": "nx:run-commands",
"options": {
Expand All @@ -53,7 +52,8 @@
},
"configurations": {
"publish": {
"push": true
"push": true,
"platforms": ["linux/amd64", "linux/arm64"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration;

@SpringBootApplication(exclude = ActiveMQAutoConfiguration.class)
@SpringBootApplication
@SuppressWarnings("checkstyle:HideUtilityClassConstructor")
public class CartApplication {

Expand Down
2 changes: 1 addition & 1 deletion src/checkout/src/checkout/checkout.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class CheckoutService {
};
});

const tax = request.shippingAddress ? Math.floor(subtotal * 0.05) : -1; // Hardcoded 5% tax for now
const tax = request.shippingAddress ? 5 : -1; // Hardcoded $10 tax for now
const effectiveTax = tax == -1 ? 0 : tax;

let shipping = -1;
Expand Down
4 changes: 2 additions & 2 deletions src/checkout/src/checkout/shipping/MockShippingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ export class MockShippingService implements IShippingService {
rates: [
{
name: `${this.prefix}Priority Mail`,
amount: 5,
amount: 10,
token: 'priority-mail',
estimatedDays: 10,
},
{
name: `${this.prefix}Priority Mail Express`,
amount: 15,
amount: 25,
token: 'priority-mail-express',
estimatedDays: 5,
},
Expand Down
2 changes: 1 addition & 1 deletion src/e2e/cypress/e2e/catalog.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("testing catalog", () => {
.cards()
.first()
.find(".product-name")
.should("contain.text", "The Quiet Quill");
.should("contain.text", "Audio-Illusion Spinner");
catalog.cards().its("length").should("eq", 6);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -149,7 +149,11 @@ public Mono<ProductPage> getProducts(
int page,
int size
) {
List<Product> productList = new ArrayList<>(this.products.values());
List<Product> productList =
this.products.values()
.stream()
.sorted(Comparator.comparing(Product::getName))
.collect(Collectors.toList());

int end = page * size;

Expand Down

0 comments on commit 5925680

Please sign in to comment.