Skip to content

Commit 29c7a44

Browse files
committed
fix tests
1 parent 2c87c14 commit 29c7a44

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

pkg/cloud/websites/websites.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ func (l *LocalWebsiteService) startServer(server *http.Server, errChan chan erro
224224

225225
// Start - Start the local website service
226226
func (l *LocalWebsiteService) Start(websites []Website) error {
227-
var errChan = make(chan error, 1)
227+
errChan := make(chan error, 1)
228228

229-
var startPort = 5000
229+
startPort := 5000
230230

231231
if l.isStartCmd {
232232
// In start mode, create individual servers for each website

pkg/dashboard/frontend/cypress/e2e/websites.cy.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,20 @@ describe('Websites Spec', () => {
2020
cy.get(`[data-rct-item-id="${id}"]`).click()
2121
cy.get('h2').should('contain.text', id)
2222

23-
const pathMap = {
24-
'vite-website': '',
25-
'docs-website': 'docs',
23+
const originMap = {
24+
'vite-website': 'http://localhost:5000',
25+
'docs-website': 'http://localhost:5001',
2626
}
2727

28-
const url = `http://localhost:5000/${pathMap[id]}`
28+
const pathMap = {
29+
'vite-website': '/',
30+
'docs-website': '/docs',
31+
}
2932

3033
// check iframe url
31-
cy.get('iframe').should('have.attr', 'src', url)
34+
cy.get('iframe').should('have.attr', 'src', originMap[id] + pathMap[id])
3235

33-
cy.visit(url)
36+
cy.visit(originMap[id] + pathMap[id])
3437

3538
const titleMap = {
3639
'vite-website': 'Hello Nitric!',
@@ -39,7 +42,7 @@ describe('Websites Spec', () => {
3942

4043
const title = titleMap[id]
4144

42-
cy.origin('http://localhost:5000', { args: { title } }, ({ title }) => {
45+
cy.origin(originMap[id], { args: { title } }, ({ title }) => {
4346
cy.get('h1').should('have.text', title)
4447
})
4548
})

0 commit comments

Comments
 (0)