2020-08-04 14:46:08 +02:00
|
|
|
describe('Toolbar', () => {
|
|
|
|
it('Toolbar loads', () => {
|
2023-12-27 09:52:28 +01:00
|
|
|
cy.get('[data-attr="menu-item-toolbarlaunch"]').click()
|
|
|
|
cy.contains('Add authorized URL').click()
|
2022-07-13 15:37:53 +02:00
|
|
|
cy.location().then((loc) => {
|
|
|
|
cy.get('[data-attr="url-input"]').clear().type(`http://${loc.host}/demo`)
|
|
|
|
cy.get('[data-attr="url-save"]').click()
|
|
|
|
cy.get('[data-attr="toolbar-open"]')
|
|
|
|
.first()
|
|
|
|
.invoke('attr', 'href')
|
|
|
|
.then((href) => {
|
|
|
|
cy.visit(href)
|
|
|
|
})
|
2023-11-23 12:54:01 +01:00
|
|
|
cy.get('#__POSTHOG_TOOLBAR__').shadow().find('.Toolbar').should('exist')
|
2022-07-13 15:37:53 +02:00
|
|
|
})
|
2020-08-04 14:46:08 +02:00
|
|
|
})
|
2022-06-20 11:04:29 +02:00
|
|
|
|
2022-06-21 09:10:29 +02:00
|
|
|
it('toolbar item in sidebar has launch options', () => {
|
2023-12-27 09:52:28 +01:00
|
|
|
cy.get('[data-attr="menu-item-toolbarlaunch"]').click()
|
|
|
|
cy.contains('Add authorized URL').click()
|
2022-06-20 11:04:29 +02:00
|
|
|
cy.location('pathname').should('include', '/toolbar')
|
|
|
|
})
|
2020-08-04 14:46:08 +02:00
|
|
|
})
|