mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Build source maps (#8695)
Builds source maps, so we can debug our frontend code on stage and production.
This commit is contained in:
parent
75d106e847
commit
2a54dc9664
23
.github/workflows/test-e2e.yml
vendored
23
.github/workflows/test-e2e.yml
vendored
@ -8,7 +8,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
|
uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f # v4.2.2
|
||||||
|
|
||||||
- name: Copy backend env file
|
- name: Copy backend env file
|
||||||
run: |
|
run: |
|
||||||
@ -46,7 +46,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
|
uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f # v4.2.2
|
||||||
|
|
||||||
- name: Copy backend env file
|
- name: Copy backend env file
|
||||||
run: |
|
run: |
|
||||||
@ -69,7 +69,13 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
|
uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f # v4.2.2
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@08f58d1471bff7f3a07d167b4ad7df25d5fcfcb6 # v4.4.0
|
||||||
|
with:
|
||||||
|
node-version-file: 'backend/.tool-versions'
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
- name: Copy env files
|
- name: Copy env files
|
||||||
run: |
|
run: |
|
||||||
@ -107,6 +113,15 @@ jobs:
|
|||||||
# run copies of the current job in parallel
|
# run copies of the current job in parallel
|
||||||
job: [1, 2, 3, 4, 5, 6, 7, 8]
|
job: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f # v4.2.2
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@08f58d1471bff7f3a07d167b4ad7df25d5fcfcb6 # v4.4.0
|
||||||
|
with:
|
||||||
|
node-version-file: 'backend/.tool-versions'
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
- name: Restore cypress cache
|
- name: Restore cypress cache
|
||||||
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.0.2
|
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.0.2
|
||||||
with:
|
with:
|
||||||
@ -172,7 +187,7 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
|
uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f # v4.2.2
|
||||||
|
|
||||||
- name: Full stack tests | cleanup cache
|
- name: Full stack tests | cleanup cache
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@ -1,14 +1,7 @@
|
|||||||
import { defineStep } from '@badeball/cypress-cucumber-preprocessor'
|
import { defineStep } from '@badeball/cypress-cucumber-preprocessor'
|
||||||
|
|
||||||
defineStep('I see all the reported posts including the one from above', () => {
|
defineStep('I see all the reported posts including the one from above', () => {
|
||||||
cy.intercept({
|
cy.wait('@reportsQuery', { timeout: 30000 }).then((interception) => {
|
||||||
method: 'POST',
|
|
||||||
url: '/api',
|
|
||||||
hostname: 'localhost',
|
|
||||||
}).as('getReports')
|
|
||||||
|
|
||||||
cy.wait(['@getReports'],{ timeout: 30000 }).then((interception) => {
|
|
||||||
console.log('Cypress interception:', interception)
|
|
||||||
cy.wrap(interception.response.statusCode).should('eq', 200)
|
cy.wrap(interception.response.statusCode).should('eq', 200)
|
||||||
cy.wrap(interception.request.body)
|
cy.wrap(interception.request.body)
|
||||||
.should('have.property', 'query', `query ($orderBy: ReportOrdering, $first: Int, $offset: Int, $reviewed: Boolean, $closed: Boolean) {
|
.should('have.property', 'query', `query ($orderBy: ReportOrdering, $first: Int, $offset: Int, $reviewed: Boolean, $closed: Boolean) {
|
||||||
@ -104,6 +97,6 @@ defineStep('I see all the reported posts including the one from above', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
cy.get('table tbody').within(() => {
|
cy.get('table tbody').within(() => {
|
||||||
cy.contains('tr', 'The Truth about the Holocaust')
|
cy.contains('tr', 'The Truth about the Holocaust').should('be.visible')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -14,6 +14,18 @@ defineStep('I click on {string}', element => {
|
|||||||
'Moderation': 'a[href="/moderation"]',
|
'Moderation': 'a[href="/moderation"]',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (element === 'Moderation') {
|
||||||
|
cy.intercept({
|
||||||
|
method: 'POST',
|
||||||
|
url: '/api',
|
||||||
|
hostname: 'localhost',
|
||||||
|
}, (req) => {
|
||||||
|
if (req.body && req.body.query && req.body.query.includes('query ($orderBy: ReportOrdering')) {
|
||||||
|
req.alias = 'reportsQuery'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
cy.get(elementSelectors[element])
|
cy.get(elementSelectors[element])
|
||||||
.click()
|
.click()
|
||||||
.wait(750)
|
.wait(750)
|
||||||
|
|||||||
@ -261,6 +261,10 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ctx.isClient) {
|
||||||
|
config.devtool = 'source-map'
|
||||||
|
}
|
||||||
|
|
||||||
config.resolve.alias['~@'] = path.resolve(__dirname, '/')
|
config.resolve.alias['~@'] = path.resolve(__dirname, '/')
|
||||||
config.resolve.alias['@@'] = path.resolve(__dirname, '/')
|
config.resolve.alias['@@'] = path.resolve(__dirname, '/')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user