Skip to content

Commit 149c848

Browse files
committed
Cleaned up Cypress testing
1 parent 475631a commit 149c848

9 files changed

Lines changed: 50 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
run: docker build -t web-ui:test .
114114

115115
- name: Start container
116-
run: docker run -d -p 5173:80 web-ui:test
116+
run: docker run -d --name webui -p 5173:80 web-ui:test
117117

118118
- name: Wait for app
119119
run: npx wait-on http://localhost:5173
@@ -136,7 +136,7 @@ jobs:
136136
run: docker build -t web-ui:test .
137137

138138
- name: Start container
139-
run: docker run -d -p 5173:80 web-ui:test
139+
run: docker run -d --name webui -p 5173:80 web-ui:test
140140

141141
- name: Wait for app
142142
run: npx wait-on http://localhost:5173
@@ -159,7 +159,7 @@ jobs:
159159
run: docker build -t web-ui:test .
160160

161161
- name: Start container
162-
run: docker run -d -p 5173:80 web-ui:test
162+
run: docker run -d --name webui -p 5173:80 web-ui:test
163163

164164
- name: Wait for app
165165
run: npx wait-on http://localhost:5173
@@ -182,7 +182,7 @@ jobs:
182182
run: docker build -t web-ui:test .
183183

184184
- name: Start container
185-
run: docker run -d -p 5173:80 web-ui:test
185+
run: docker run -d --name webui -p 5173:80 web-ui:test
186186

187187
- name: Wait for app
188188
run: npx wait-on http://localhost:5173
@@ -205,7 +205,7 @@ jobs:
205205
run: docker build -t web-ui:test .
206206

207207
- name: Start container
208-
run: docker run -d -p 5173:80 web-ui:test
208+
run: docker run -d --name webui -p 5173:80 web-ui:test
209209

210210
- name: Wait for app
211211
run: npx wait-on http://localhost:5173

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ RUN npm run build
77

88
FROM nginx:stable-alpine
99
COPY --from=build /app/dist /usr/share/nginx/html
10+
COPY nginx.conf /etc/nginx/conf.d/default.conf
1011
EXPOSE 80
1112
CMD ["nginx", "-g", "daemon off;"]

cypress/e2e/dashboard/dashboard.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe("Dashboard Page", () => {
22
it("displays the correct main title", () => {
3-
cy.visit("http://localhost:3000")
3+
cy.visit("localhost:5173")
44

55
cy.get("h1").should("contain", "My Dashboard")
66
})

cypress/e2e/events/events.cy.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe("Event Page", () => {
2+
it("displays the correct main title", () => {
3+
cy.visit("localhost:5173/events")
4+
5+
cy.get("h1").should("contain", "My Events")
6+
})
7+
})
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe("Insights Page", () => {
2+
it("displays the correct main title", () => {
3+
cy.visit("localhost:5173/insights")
4+
5+
cy.get("h1").should("contain", "Insights")
6+
})
7+
})
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe("Organizations Page", () => {
2+
it("displays the correct main title", () => {
3+
cy.visit("localhost:5173/organizations")
4+
5+
cy.get("h1").should("contain", "My Organizations")
6+
})
7+
})

cypress/e2e/profile/profile.cy.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
describe("Profile Page", () => {
2+
it("displays the correct main title", () => {
3+
cy.visit("localhost:5173/profile")
4+
5+
cy.get("h1").should("contain", "My Profile")
6+
})
7+
})

cypress/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"compilerOptions": {
3+
"types": ["cypress"]
4+
},
5+
"include": ["**/*.ts"]
6+
}

nginx.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
server {
2+
listen 80;
3+
4+
location / {
5+
root /usr/share/nginx/html;
6+
index index.html;
7+
try_files $uri /index.html;
8+
}
9+
}

0 commit comments

Comments
 (0)