-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from Geoportail-Luxembourg/GSLUX-734-my-symbols
GSLUX-734: My symbols
- Loading branch information
Showing
53 changed files
with
2,846 additions
and
2,011 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,19 +38,7 @@ describe('Authentification', () => { | |
|
||
describe('When user is authenticating with success', () => { | ||
beforeEach(() => { | ||
cy.intercept('POST', '/login', { | ||
statusCode: 200, | ||
body: { | ||
login: 'MyLogin', | ||
mail: '[email protected]', | ||
}, | ||
}) | ||
cy.get('header [data-cy="authFormIcon"]').click() | ||
cy.get('[data-cy="authForm"] input[name="userName"]').type('MyLogin') | ||
cy.get('[data-cy="authForm"] input[name="userPassword"]').type( | ||
'Rand87321mdp' | ||
) | ||
cy.get('[data-cy="authForm"] input[type="submit"]').click() | ||
cy.login() | ||
}) | ||
|
||
it('authenticates the user, hides the form and display the success notification msg', () => { | ||
|
@@ -73,23 +61,11 @@ describe('Authentification', () => { | |
|
||
describe('When user is logging out', () => { | ||
beforeEach(() => { | ||
cy.intercept('POST', '/login', { | ||
statusCode: 200, | ||
body: { | ||
login: 'MyLogin', | ||
mail: '[email protected]', | ||
}, | ||
}) | ||
cy.intercept('GET', '/logout', { | ||
statusCode: 200, | ||
body: {}, | ||
}) | ||
cy.get('[data-cy="authFormIcon"]').click() | ||
cy.get('[data-cy="authForm"] input[name="userName"]').type('MyLogin') | ||
cy.get('[data-cy="authForm"] input[name="userPassword"]').type( | ||
'Rand87321mdp' | ||
) | ||
cy.get('[data-cy="authForm"] input[type="submit"]').click() | ||
cy.login() | ||
}) | ||
|
||
it('logs out the user and display back the login form', () => { | ||
|
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,121 @@ | ||
describe('Draw "Point" symbols', () => { | ||
beforeEach(() => { | ||
cy.intercept( | ||
'GET', | ||
'/raster?lon=-25877.619036593664&lat=154433.4715351454', | ||
{ | ||
statusCode: 200, | ||
body: { | ||
dhm: null, | ||
}, | ||
} | ||
) | ||
cy.intercept( | ||
'GET', | ||
'/raster?lon=12756.103097272688&lat=114635.74032468312', | ||
{ | ||
statusCode: 200, | ||
body: { | ||
dhm: 333.13, | ||
}, | ||
} | ||
) | ||
cy.intercept('GET', '/raster?lon=51966.98676810359&lat=74839.09999860045', { | ||
statusCode: 500, | ||
body: {}, | ||
}) | ||
|
||
cy.visit('/') | ||
cy.get('button[data-cy="drawButton"]').click() | ||
cy.get('button[data-cy="drawPointButton"]').click() | ||
cy.get('div.ol-viewport').click(100, 100) | ||
cy.get('[data-cy="featItemActionStyle"]').click() | ||
cy.get('[data-cy="featStyleSymbolEdit"]').click() | ||
}) | ||
|
||
describe('When editing symbol', () => { | ||
describe('When browsing public symbols', () => { | ||
beforeEach(() => { | ||
cy.get('[data-cy="featStyleSymbolTab"]').eq(1).click() | ||
}) | ||
|
||
it('displays the public symbol list', () => { | ||
cy.get('[data-cy="featStyleSymbolFilterList"]').should('exist') | ||
cy.get('[data-cy="featStyleSymbolIcon"]').should('have.length', 81) | ||
}) | ||
|
||
describe('When filtering public symbols', () => { | ||
it('displays the public symbol list', () => { | ||
cy.get('[data-cy="featStyleSymbolFilterList"]').type('pin1') | ||
cy.get('[data-cy="featStyleSymbolIcon"]').should('have.length', 2) | ||
}) | ||
}) | ||
|
||
describe('When choosing a symbol', () => { | ||
it('should close the list', () => { | ||
cy.get('[data-cy="featStyleSymbolFilterList"]').should('exist') | ||
cy.get('[data-cy="featStyleSymbolIcon"]').eq(1).click() | ||
cy.get('[data-cy="featStyleSymbolFilterList"]').should('not.exist') | ||
}) | ||
}) | ||
}) | ||
|
||
describe('When browsing private symbols', () => { | ||
beforeEach(() => { | ||
cy.intercept('GET', /\/symbols\?symboltype=us/, { | ||
statusCode: 200, | ||
body: { | ||
success: true, | ||
count: 2, | ||
results: [ | ||
{ | ||
id: 1915, | ||
name: 'foo symbol 1', | ||
url: '/symbol/1915', | ||
symboltype: 'us', | ||
}, | ||
{ | ||
id: 1998, | ||
name: 'foo symbol 2', | ||
url: '/symbol/1998', | ||
symboltype: 'us', | ||
}, | ||
], | ||
}, | ||
}).as('getSymbols') | ||
cy.intercept('POST', /\/mymaps\/upload_symbol/, { | ||
statusCode: 200, | ||
}) | ||
cy.login() | ||
cy.get('[data-cy="featStyleSymbolTab_private"]').click() | ||
}) | ||
|
||
it('displays the public symbols tab and the private symbols tab', () => { | ||
cy.get('[data-cy="featStyleSymbolFilterList"]').should('exist') | ||
cy.get('[data-cy="featStyleSymbolIcon"]').should('have.length', 2) | ||
}) | ||
|
||
describe('When filtering private symbols', () => { | ||
it('displays the filtered private symbol list', () => { | ||
cy.get('[data-cy="featStyleSymbolFilterList"]').type('symbol 1') | ||
cy.get('[data-cy="featStyleSymbolIcon"]').should('have.length', 1) | ||
}) | ||
}) | ||
|
||
describe('When uploading file', () => { | ||
it('refreshes the private symbol list list', () => { | ||
cy.get('input[type=file]').selectFile( | ||
{ | ||
contents: Cypress.Buffer.from('file contents'), | ||
fileName: 'file.txt', | ||
mimeType: 'text/plain', | ||
lastModified: Date.now(), | ||
}, | ||
{ force: true } | ||
) | ||
cy.get('@getSymbols.all').should('have.length', 2) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
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
Oops, something went wrong.