-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Unité] Ajout des bases sur la carte (#2726)
## Linked issues - MTES-MCT/monitorenv#698 ---- - [x] Tests E2E (Cypress)
- Loading branch information
Showing
60 changed files
with
1,296 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class MockedMap {} | ||
MockedMap.prototype.getCoordinateFromPixel = jest.fn() | ||
MockedMap.prototype.getPixelFromCoordinate = jest.fn() | ||
|
||
module.exports = MockedMap | ||
module.exports.default = MockedMap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
context('Main Window > Station Overlay', () => { | ||
beforeEach(() => { | ||
cy.visit(`/#@-282045.85,6101658.31,9.11`).wait(5000) | ||
|
||
cy.clickButton('Liste des unités de contrôle') | ||
cy.clickButton('Afficher les bases').wait(1000) | ||
}) | ||
|
||
it('Should show the expected station card when selected', () => { | ||
// Click on Vannes base | ||
cy.get('.ol-viewport').click(550, 650, { force: true }) | ||
|
||
cy.getDataCy('StationOverlay-card').contains('Vannes').should('be.visible') | ||
cy.getDataCy('StationOverlay-card').contains('Cultures marines 56').should('be.visible') | ||
cy.getDataCy('StationOverlay-card').find('.Element-Tag').eq(0).should('have.text', '1 Vedette') | ||
cy.getDataCy('StationOverlay-card').find('.Element-Tag').eq(1).should('have.text', '1 Voiture') | ||
}) | ||
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...onents/ControlUnitListDialog/__tests__/displayControlUnitResourcesFromControlUnit.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { describe, expect, it } from '@jest/globals' | ||
import { ControlUnit } from '@mtes-mct/monitor-ui' | ||
|
||
import { displayControlUnitResourcesFromControlUnit } from '../utils' | ||
|
||
describe('features/ControlUnit/components/ControlUnitListDialog/utils > displayControlUnitResourcesFromControlUnit()', () => { | ||
it('should return formatted resource string for multiple resources', () => { | ||
const controlUnit = { | ||
controlUnitResources: [ | ||
{ isArchived: false, type: ControlUnit.ControlUnitResourceType.CAR }, | ||
{ isArchived: false, type: ControlUnit.ControlUnitResourceType.CAR }, | ||
{ isArchived: false, type: ControlUnit.ControlUnitResourceType.DRONE } | ||
] | ||
} as unknown as ControlUnit.ControlUnit | ||
|
||
const result = displayControlUnitResourcesFromControlUnit(controlUnit) | ||
|
||
expect(result).toEqual('2 Voitures, 1 Drône') | ||
}) | ||
|
||
it('should handle empty resource list', () => { | ||
const controlUnit = { | ||
controlUnitResources: [] | ||
} as unknown as ControlUnit.ControlUnit | ||
|
||
const result = displayControlUnitResourcesFromControlUnit(controlUnit) | ||
|
||
expect(result).toEqual('Aucun moyen') | ||
}) | ||
|
||
it('should not count archived resources', () => { | ||
const controlUnit = { | ||
controlUnitResources: [ | ||
{ isArchived: true, type: ControlUnit.ControlUnitResourceType.CAR }, | ||
{ isArchived: false, type: ControlUnit.ControlUnitResourceType.DRONE } | ||
] | ||
} as unknown as ControlUnit.ControlUnit | ||
|
||
const result = displayControlUnitResourcesFromControlUnit(controlUnit) | ||
expect(result).toEqual('1 Drône') | ||
}) | ||
}) |
Oops, something went wrong.