Skip to content
This repository was archived by the owner on Sep 23, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
2f888ea
build(dashboard): add office-ui-fabric-react to dependencies
Gianfranco97 Jul 27, 2018
348e03e
refactor(dashboard): use the Fabric icons
Gianfranco97 Jul 27, 2018
cf4b1d5
test(cypress): update test to work with the new icons
Gianfranco97 Jul 30, 2018
918512e
test(dashboard): fix integration with jest
Gianfranco97 Jul 30, 2018
4d68488
refactor(dashboard): create a custom theme to Fabric components
Gianfranco97 Jul 30, 2018
bd836b6
refactor(dashboard): use the 'Spinner' Fabric component to loadings
Gianfranco97 Jul 30, 2018
d608b5a
refactor(dashboard): change the 'Confirmation' component
Gianfranco97 Jul 31, 2018
8f7d9c1
refactor(withAdminDashboardLayout): use the new Confirmation component
Gianfranco97 Jul 31, 2018
e692a9c
refactor(Forms): use the new Confirmation component
Gianfranco97 Jul 31, 2018
00cf9e1
refactor(applications): use the new Confirmation component
Gianfranco97 Jul 31, 2018
cfb55c7
refactor(devices): use the new Confirmation component
Gianfranco97 Jul 31, 2018
7b9f897
refactor(files): use the new Confirmation component
Gianfranco97 Jul 31, 2018
0438ae2
refactor(fleets): use the new Confirmation component
Gianfranco97 Jul 31, 2018
e2aa565
refactor(invitations): use the new Confirmation component
Gianfranco97 Jul 31, 2018
4829b89
refactor(users): use the new Confirmation component
Gianfranco97 Jul 31, 2018
eb20939
refactor(settings): use the new Confirmation component
Gianfranco97 Jul 31, 2018
d60597e
refactor(devices): use the new Confirmation component
Gianfranco97 Jul 31, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 73 additions & 75 deletions cypress/integration/Applications.spec.js

Large diffs are not rendered by default.

36 changes: 13 additions & 23 deletions cypress/integration/Devices.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 35 additions & 37 deletions cypress/integration/Files.spec.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
import '../../public/config'

describe('Files', () => {
beforeEach(function () {
beforeEach(() => {
cy.server()

cy.route({
method: 'GET',
url: `${window.appConfig.glpiApiLink}/search/PluginFlyvemdmFile/?uid_cols=true&forcedisplay[0]=1&forcedisplay[1]=2&forcedisplay[2]=3&order=ASC&range=0-14&`,
response: {
"totalcount": 4,
"count": 4,
"sort": 1,
"order": "ASC",
"data": [{
"PluginFlyvemdmFile.name": "decoded.jpeg",
"PluginFlyvemdmFile.id": 78,
"PluginFlyvemdmFile.source": "0/5b11be1376218_decoded.jpeg"
totalcount: 4,
count: 4,
sort: 1,
order: 'ASC',
data: [{
'PluginFlyvemdmFile.name': 'decoded.jpeg',
'PluginFlyvemdmFile.id': 78,
'PluginFlyvemdmFile.source': '0/5b11be1376218_decoded.jpeg',
}, {
"PluginFlyvemdmFile.name": "IMG.jpg",
"PluginFlyvemdmFile.id": 79,
"PluginFlyvemdmFile.source": "0/5b11be206c719_IMG_20180330_110129.jpg"
'PluginFlyvemdmFile.name': 'IMG.jpg',
'PluginFlyvemdmFile.id': 79,
'PluginFlyvemdmFile.source': '0/5b11be206c719_IMG_20180330_110129.jpg',
}, {
"PluginFlyvemdmFile.name": "logo-plugin.png",
"PluginFlyvemdmFile.id": 48,
"PluginFlyvemdmFile.source": "0/5acb72372edb7_logo-plugin.png"
'PluginFlyvemdmFile.name': 'logo-plugin.png',
'PluginFlyvemdmFile.id': 48,
'PluginFlyvemdmFile.source': '0/5acb72372edb7_logo-plugin.png',
}, {
"PluginFlyvemdmFile.name": "logo2.png",
"PluginFlyvemdmFile.id": 43,
"PluginFlyvemdmFile.source": "0/5abd12701feb2_logo2.png"
'PluginFlyvemdmFile.name': 'logo2.png',
'PluginFlyvemdmFile.id': 43,
'PluginFlyvemdmFile.source': '0/5abd12701feb2_logo2.png',
}],
"content-range": "0-3/4"
}
'content-range': '0-3/4',
},
})

cy.route({
method: 'GET',
url: `${window.appConfig.glpiApiLink}/getGlpiConfig`,
response: {
"cfg_glpi": {
cfg_glpi: {
password_min_length: 10,
password_need_number: 1,
password_need_letter: 1,
password_need_caps: 1,
password_need_symbol: 1,
url_base: "https://your-url.com/glpi"
}
}
url_base: 'https://your-url.com/glpi',
},
},
})

localStorage.setItem('sessionToken', 'token1234')
Expand All @@ -55,11 +55,10 @@ describe('Files', () => {
localStorage.setItem('currentUser',
JSON.stringify({
id: 123,
name: "exampleName",
email: "example@teclib.com",
picture: null
})
)
name: 'exampleName',
email: 'example@teclib.com',
picture: null,
}))

localStorage.setItem('display',
JSON.stringify({
Expand All @@ -72,32 +71,31 @@ describe('Files', () => {
invitationsSent: false,
numberUsers: false,
animations: false,
pendingInvitations: false
})
)
pendingInvitations: false,
}))
})

it('should navigate in users without problemss', () => {
cy.visit('/app/files')
cy.contains('No selection')
cy.get('#element__11')
cy.get('main').screenshot('files_noSelection', {
capture: 'viewport'
capture: 'viewport',
})
cy.get('.win-itemscontainer').click('top')
cy.get('.header-block').click('topRight')
cy.get('main').screenshot('files_content', {
capture: 'viewport'
capture: 'viewport',
})
cy.get('.editIcon').click()
cy.get('[data-icon-name="Edit"]').click()
cy.get('.header-block').click('topRight')
cy.get('main').screenshot('files_edit', {
capture: 'viewport'
capture: 'viewport',
})
cy.get('[aria-label="Add"] > .win-commandicon > .win-commandimage').click()
cy.get('.header-block').click('topRight')
cy.get('main').screenshot('files_add', {
capture: 'viewport'
capture: 'viewport',
})
})
})
30 changes: 14 additions & 16 deletions cypress/integration/Logout.spec.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import '../../public/config'

describe('Users', () => {
beforeEach(function () {
describe('Logout', () => {
beforeEach(() => {
cy.server()

cy.route({
method: 'GET',
url: `${window.appConfig.glpiApiLink}/getGlpiConfig`,
response: {
"cfg_glpi": {
cfg_glpi: {
password_min_length: 10,
password_need_number: 1,
password_need_letter: 1,
password_need_caps: 1,
password_need_symbol: 1,
url_base: "https://your-url.com/glpi"
}
}
url_base: 'https://your-url.com/glpi',
},
},
})


Expand All @@ -27,11 +27,10 @@ describe('Users', () => {
localStorage.setItem('currentUser',
JSON.stringify({
id: 123,
name: "exampleName",
email: "example@teclib.com",
picture: null
})
)
name: 'exampleName',
email: 'example@teclib.com',
picture: null,
}))

localStorage.setItem('display',
JSON.stringify({
Expand All @@ -44,16 +43,15 @@ describe('Users', () => {
invitationsSent: false,
numberUsers: false,
animations: false,
pendingInvitations: false
})
)
pendingInvitations: false,
}))
})

it('should logout without problems', () => {
cy.visit('/app')
cy.get('.PowerButtonIcon').click()
cy.get('[role="link"] > a > span > .root-36').click()
cy.get('main').screenshot('logout', {
capture: 'viewport'
capture: 'viewport',
})
})
})
70 changes: 37 additions & 33 deletions cypress/integration/Users.spec.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,60 @@
import '../../public/config'

describe('Users', () => {
beforeEach(function () {
beforeEach(() => {
cy.server()

cy.route({
method: 'GET',
url: `${window.appConfig.glpiApiLink}/search/User/?uid_cols=true&forcedisplay[0]=1&forcedisplay[1]=2&forcedisplay[2]=5&forcedisplay[3]=34&forcedisplay[4]=150&order=ASC&range=0-14&`,
response: {
"totalcount": 2,
"count": 2,
"content-range": "0-1/2",
"order": "ASC",
"sort": 1,
"data": [
{"User.name":"User 1","User.id":1,"User.UserEmail.email":"user1@teclib.com","User.realname":"New user","User.picture":null},
{"User.name":"User 2","User.id":2,"User.UserEmail.email":"user2@teclib.com","User.realname":"Old user","User.picture":null},
]
}
totalcount: 2,
count: 2,
'content-range': '0-1/2',
order: 'ASC',
sort: 1,
data: [
{
'User.name': 'User 1', 'User.id': 1, 'User.UserEmail.email': 'user1@teclib.com', 'User.realname': 'New user', 'User.picture': null,
},
{
'User.name': 'User 2', 'User.id': 2, 'User.UserEmail.email': 'user2@teclib.com', 'User.realname': 'Old user', 'User.picture': null,
},
],
},
})

cy.route({
method: 'GET',
url: `${window.appConfig.glpiApiLink}/User/1`,
response: {
"id":1,"name":"User 1","phone":null,"phone2":null,"mobile":null,"realname":"New user","firstname":null,"locations_id":0,"language":null,"use_mode":0,"list_limit":null,"is_active":1,"comment":null,"auths_id":0,"authtype":1,"last_login":null,"date_mod":"2018-06-04 17:17:12","date_sync":null,"is_deleted":0,"profiles_id":0,"entities_id":0,"usertitles_id":0,"usercategories_id":0,"date_format":null,"number_format":null,"names_format":null,"csv_delimiter":null,"is_ids_visible":null,"use_flat_dropdowntree":null,"show_jobs_at_login":null,"priority_1":null,"priority_2":null,"priority_3":null,"priority_4":null,"priority_5":null,"priority_6":null,"followup_private":null,"task_private":null,"default_requesttypes_id":null,"password_forget_token":null,"password_forget_token_date":null,"user_dn":null,"registration_number":null,"show_count_on_tabs":null,"refresh_ticket_list":null,"set_default_tech":null,"personal_token":null,"personal_token_date":null,"display_count_on_home":null,"notification_to_myself":null,"duedateok_color":null,"duedatewarning_color":null,"duedatecritical_color":null,"duedatewarning_less":null,"duedatecritical_less":null,"duedatewarning_unit":null,"duedatecritical_unit":null,"display_options":null,"is_deleted_ldap":0,"pdffont":null,"picture":"profile.png","begin_date":null,"end_date":null,"keep_devices_when_purging_item":null,"privatebookmarkorder":null,"backcreated":null,"task_state":null,"layout":null,"palette":null,"ticket_timeline":null,"ticket_timeline_keep_replaced_tabs":null,"set_default_requester":null,"lock_autolock_mode":null,"lock_directunlock_notification":null,"date_creation":"2018-05-30 23:07:57","highcontrast_css":0,"plannings":null,"api_token":"KHsR7XIbbTMtGlKZrVzfWrHSuD34LFxBiY6ixdxp","api_token_date":"2018-05-30 23:07:57","sync_field":null
}
id: 1, name: 'User 1', phone: null, phone2: null, mobile: null, realname: 'New user', firstname: null, locations_id: 0, language: null, use_mode: 0, list_limit: null, is_active: 1, comment: null, auths_id: 0, authtype: 1, last_login: null, date_mod: '2018-06-04 17:17:12', date_sync: null, is_deleted: 0, profiles_id: 0, entities_id: 0, usertitles_id: 0, usercategories_id: 0, date_format: null, number_format: null, names_format: null, csv_delimiter: null, is_ids_visible: null, use_flat_dropdowntree: null, show_jobs_at_login: null, priority_1: null, priority_2: null, priority_3: null, priority_4: null, priority_5: null, priority_6: null, followup_private: null, task_private: null, default_requesttypes_id: null, password_forget_token: null, password_forget_token_date: null, user_dn: null, registration_number: null, show_count_on_tabs: null, refresh_ticket_list: null, set_default_tech: null, personal_token: null, personal_token_date: null, display_count_on_home: null, notification_to_myself: null, duedateok_color: null, duedatewarning_color: null, duedatecritical_color: null, duedatewarning_less: null, duedatecritical_less: null, duedatewarning_unit: null, duedatecritical_unit: null, display_options: null, is_deleted_ldap: 0, pdffont: null, picture: 'profile.png', begin_date: null, end_date: null, keep_devices_when_purging_item: null, privatebookmarkorder: null, backcreated: null, task_state: null, layout: null, palette: null, ticket_timeline: null, ticket_timeline_keep_replaced_tabs: null, set_default_requester: null, lock_autolock_mode: null, lock_directunlock_notification: null, date_creation: '2018-05-30 23:07:57', highcontrast_css: 0, plannings: null, api_token: 'KHsR7XIbbTMtGlKZrVzfWrHSuD34LFxBiY6ixdxp', api_token_date: '2018-05-30 23:07:57', sync_field: null,
},
})

cy.route({
method: 'GET',
url: `${window.appConfig.glpiApiLink}/User/1/UserEmail`,
response: [
{"id":12,"users_id":1,"is_default":1,"is_dynamic":0,"email":"user1@teclib.com","links":[{"rel":"User","href":"https://dev.flyve.org/glpi/apirest.php/User/1"}]}
]
{
id: 12, users_id: 1, is_default: 1, is_dynamic: 0, email: 'user1@teclib.com', links: [{ rel: 'User', href: 'https://dev.flyve.org/glpi/apirest.php/User/1' }],
},
],
})

cy.route({
method: 'GET',
url: `${window.appConfig.glpiApiLink}/getGlpiConfig`,
response: {
"cfg_glpi":{
cfg_glpi: {
password_min_length: 10,
password_need_number: 1,
password_need_letter: 1,
password_need_caps: 1,
password_need_symbol: 1,
url_base: "https://your-url.com/glpi"
}
}
url_base: 'https://your-url.com/glpi',
},
},
})

localStorage.setItem('sessionToken', 'token1234')
Expand All @@ -57,12 +63,11 @@ describe('Users', () => {

localStorage.setItem('currentUser',
JSON.stringify({
id:123,
name:"exampleName",
email: "example@teclib.com",
picture: null
})
)
id: 123,
name: 'exampleName',
email: 'example@teclib.com',
picture: null,
}))

localStorage.setItem('display',
JSON.stringify({
Expand All @@ -75,23 +80,22 @@ describe('Users', () => {
invitationsSent: false,
numberUsers: false,
animations: false,
pendingInvitations: false
})
)
pendingInvitations: false,
}))
})

it('should navigate in users without problemss', () => {
cy.visit('/app/users')
cy.contains('No selection')
cy.get('#element__11')
cy.get('main').screenshot('users_noSelection', {capture: 'viewport'})
cy.get('main').screenshot('users_noSelection', { capture: 'viewport' })
cy.get('.win-itemscontainer').click('top')
cy.get('.item-info__name')
cy.get('.header-block').click('topRight')
cy.get('main').screenshot('users_content', {capture: 'viewport'})
cy.get('.editIcon').click()
cy.get('.viewIcon')
cy.get('main').screenshot('users_content', { capture: 'viewport' })
cy.get('[data-icon-name="Edit"]').click()
cy.get('.froms > :nth-child(1) > .root-34')
cy.get('.header-block').click('topRight')
cy.get('main').screenshot('users_edit', {capture: 'fullPage'})
cy.get('main').screenshot('users_edit', { capture: 'fullPage' })
})
})
Loading