Skip to content

Commit

Permalink
Add UI unit tests (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrod-lowe authored Aug 25, 2024
1 parent 618f5b9 commit 0a1c4cc
Show file tree
Hide file tree
Showing 11 changed files with 9,255 additions and 2,711 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ ui/public/*
ui/dist/*
!ui/dist/.emptyDir
ui/.push
ui/coverage
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ terraform/environment/%/.validate: terraform/environment/%/*.tf terraform-format
touch $@

.PHONY: dev
dev: $(GRAPHQL_DEV) terraform-format terraform/environment/aws-dev/.apply terraform/environment/wildsea-dev/.apply ui/.push
@true
dev: ui/config/output-dev.json $(GRAPHQL_DEV) terraform-format terraform/environment/aws-dev/.apply terraform/environment/wildsea-dev/.apply ui/.push
@echo URL is "https://$$(jq -r .cdn_domain_name.value $<)/"

terraform/environment/aws-dev/.apply: terraform/environment/aws-dev/*.tf terraform/module/iac-roles/*.tf
AUTO_APPROVE=yes ./terraform/environment/aws-dev/deploy.sh $(ACCOUNT_ID) dev
Expand Down Expand Up @@ -64,8 +64,10 @@ clean:
rm -f graphql/mutation/*/appsync.js
rm -f graphql/query/*/appsync.js
rm -rf graphql/node_modules
rm -rf graphql/coverage
rm -rf appsync/node_modules
rm -rf ui/node_modules
rm -f ui/config/*
rm -f ui/public/*
rm -rf ui/dist/*
rm -rf ui/coverage
4 changes: 4 additions & 0 deletions terraform/environment/wildsea-dev/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ output "ui_bucket" {
output "cdn_id" {
value = module.wildsea.cdn_id
}

output "cdn_domain_name" {
value = module.wildsea.cdn_domain_name
}
4 changes: 4 additions & 0 deletions terraform/module/wildsea/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ output "ui_bucket" {
output "cdn_id" {
value = aws_cloudfront_distribution.cdn.id
}

output "cdn_domain_name" {
value = aws_cloudfront_distribution.cdn.domain_name
}
6 changes: 6 additions & 0 deletions ui/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
transform: { "^.+\\.ts?$": "ts-jest" },
testEnvironment: "node",
testRegex: "/tests/.*\\.(test|spec)?\\.(ts|tsx)$",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"]
};
Loading

0 comments on commit 0a1c4cc

Please sign in to comment.