Skip to content

Commit

Permalink
Revert "feat: ❇️ add tutorial to secure a firearm (#159)"
Browse files Browse the repository at this point in the history
This reverts commit e1edd0a.
  • Loading branch information
nutfdt authored Oct 10, 2023
1 parent e1edd0a commit 1e4a0b6
Show file tree
Hide file tree
Showing 208 changed files with 3,849 additions and 6,018 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Try to find error log
* In terminal, run `docker logs basegun-backend`
* If you cannot access terminal or don't see anything, go to `localhost:5000/logs` or `preprod.basegun.fr/logs` to see latest logs.

=> ErrorPage "missing model": Download model from the url specified in the [backend Dockerfile](https://github.com/datalab-mi/Basegun/blob/develop/backend/Dockerfile).
=> Error "missing model": Download model from the url specified in the [backend Dockerfile](https://github.com/datalab-mi/Basegun/blob/develop/backend/Dockerfile).

### The website runs the analysis, but no image shows up
Use browser html inspector to find the url given in the image src.
Expand Down
33 changes: 0 additions & 33 deletions docker-compose-backend.yml

This file was deleted.

12 changes: 0 additions & 12 deletions frontend/.editorconfig

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG NODE_EXTRA_CA_CERTS
COPY ./cert/. /etc/ssl/certs/

COPY ./package.json ./package-lock.json ./
RUN npm ci --legacy-peer-deps
RUN npm ci

COPY src ./src
COPY public ./public
Expand Down
10 changes: 5 additions & 5 deletions frontend/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ const frontendPort = process.env.FRONTEND_PORT

module.exports = defineConfig({
e2e: {
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,ts}',
specPattern: "cypress/e2e/**/*.{cy,spec}.{js,ts}",
baseUrl: `http://${frontendHost}:${frontendPort}`,
// NEO - Crosscall X4 - Résolution : 18:9
// Iphone XR
viewportWidth: 414,
viewportHeight: 896,
viewportWidth: 414,
viewportHeight: 896,
video: false,
},
})
}
})
76 changes: 0 additions & 76 deletions frontend/cypress/e2e/firearm-fiability.cy.js

This file was deleted.

61 changes: 0 additions & 61 deletions frontend/cypress/e2e/firearm-identification.cy.js

This file was deleted.

30 changes: 0 additions & 30 deletions frontend/cypress/e2e/firearm-securing.cy.js

This file was deleted.

45 changes: 45 additions & 0 deletions frontend/cypress/e2e/get-basegun-result.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
describe('Get Basegun result', () => {
it('should have dummy button enabled', () => {
cy.visit('/')
cy.get('.swiper-button-next').click()
cy.get('#position-button')
.contains('J\'ai compris')
.click()
cy.url()
.should('contain', '/accueil')
cy.getByDataTestid('start')
.contains('Démarrer')
.click()
cy.url()
.should('contain', '/instructions')
cy.contains('h3', 'Pour un résultat optimal')
cy.contains('span', 'canon vers la droite')

cy.getByDataTestid('select-file').as('fileInput')
cy.intercept('POST','/api/upload').as('upload')
cy.get('@fileInput').selectFile('./cypress/images/pistolet-semi-auto.jpg', { force: true })
cy.wait('@upload').then(({ response }) => {
expect(response.statusCode).to.eq(200)
})
cy.url().should('contain','/resultat')
cy.getByDataTestid('legal-category').contains('Catégorie B')
cy.getByDataTestid('dummy-button')
.should('be.enabled')
.contains('Vérifier si l\'arme est factice')
})

it('should have dummy button disabled', () => {
cy.visit('/instructions')
cy.getByDataTestid('select-file').as('fileInput')
cy.intercept('POST','/api/upload').as('upload')
cy.get('@fileInput').selectFile('./cypress/images/pistolet-ancien-a-percussion-monocoup.jpg', { force: true })
cy.wait('@upload').then(({ response }) => {
expect(response.statusCode).to.eq(200)
})
cy.url().should('contain','/resultat')
cy.getByDataTestid('legal-category').contains('D')
cy.getByDataTestid('dummy-button')
.should('be.disabled')
.contains('Pas de guide de vérification')
})
})
38 changes: 17 additions & 21 deletions frontend/cypress/e2e/home.cy.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
describe('HomePage', () => {
it('shoud visit HomePage', () => {
cy.visit('/')
cy.getByDataTestid('basegun-logo').should('exist')
cy.contains('li', 'Basegun est une application')
cy.get('swiper-container').shadow().find('.swiper-button-next').click()
cy.contains('li', 'ne remplace en aucun cas l\'avis d\'un expert')
cy.get('#agree-button').contains('J\'ai compris').click()
cy.url().should('contain', '/accueil')
})

it('shoud visit HomePage', () => {
cy.visit('/')
cy.getByDataTestid('basegun-logo').should('exist')
cy.contains('li', 'Basegun est une application')
cy.get('.swiper-button-next').click()
cy.contains('li', 'Une arme doit toujours être')
cy.get('#position-button').contains('J\'ai compris').click()
cy.url().should('contain', '/accueil')
})
it('should open Menu informations', () => {
cy.visit('/')
cy.getByDataTestid('header-logo').contains('Ministère')
Expand All @@ -20,28 +20,24 @@ describe('HomePage', () => {
.click()
cy.url()
.should('contain', '/a-propos')
cy.contains('p', 'Basegun est un projet')

cy.get('#button-menu')
.click()
cy.getByRole('navigation')
.contains('a', 'Mentions légales')
.click()
cy.url()
.should('contain', '/mentions-legales')
cy.contains('p', 'basegun.fr')

cy.get('#button-menu')
.click()
cy.getByRole('navigation')
.contains('a', 'Contact')
.click()
cy.url()
.should('contain', '/contact')
cy.contains('a', '[email protected]')
cy.getByRole('navigation')
.contains('a', 'Important')
.click({ force: true })
})
},
)
cy.get('.information')
.should('exist')
.click()
cy.url().should('contain','/')
})
}
)
16 changes: 0 additions & 16 deletions frontend/cypress/e2e/old-mechanism-pistol-securing.cy.js

This file was deleted.

Loading

0 comments on commit 1e4a0b6

Please sign in to comment.