This commit is contained in:
ogerly 2022-08-17 10:51:25 +02:00
parent 212ad3aae9
commit 0be22fcc27
3 changed files with 130 additions and 128 deletions

View File

@ -47,7 +47,6 @@ describe('GddSend confirm', () => {
})
})
describe('has totalBalance under 0', () => {
beforeEach(async () => {
await wrapper.setProps({

View File

@ -46,27 +46,36 @@ describe('Sidebar', () => {
expect(wrapper.findAll('.nav-item').at(1).text()).toEqual('navigation.send')
})
it('has first nav-item "gdt.gdt" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(3).text()).toEqual('gdt.gdt')
it('has first nav-item "gdt.gdt" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(3).text()).toEqual('gdt.gdt')
})
it('has first nav-item "navigation.community" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(4).text()).toContain('navigation.community')
})
it('has first nav-item "navigation.profile" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.profile')
})
})
it('has first nav-item "navigation.community" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(4).text()).toContain('navigation.community')
})
describe('navigation Navbar (user has an elopage account)', () => {
it('has eight b-nav-item in the navbar', () => {
expect(wrapper.findAll('.nav-item')).toHaveLength(9)
})
it('has first nav-item "navigation.profile" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.profile')
})
})
it('has a link to the members area', () => {
expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.members_area')
expect(wrapper.findAll('.nav-item').at(6).find('a').attributes('href')).toBe('#')
})
describe('navigation Navbar (user has an elopage account)', () => {
it('has eight b-nav-item in the navbar', () => {
expect(wrapper.findAll('.nav-item')).toHaveLength(9)
})
it('has first nav-item "navigation.admin_area" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.admin_area')
})
it('has a link to the members area', () => {
expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.members_area')
expect(wrapper.findAll('.nav-item').at(6).find('a').attributes('href')).toBe('#')
it('has first nav-item "navigation.logout" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(8).text()).toEqual('navigation.logout')
})
})
it('has first nav-item "navigation.admin_area" in navbar', () => {
@ -78,51 +87,41 @@ describe('Sidebar', () => {
})
})
it('has first nav-item "navigation.admin_area" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.admin_area')
})
it('has first nav-item "navigation.logout" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(8).text()).toEqual('navigation.logout')
})
describe('navigation Navbar (user has no elopage account)', () => {
beforeAll(() => {
mocks.$store.state.hasElopage = false
wrapper = Wrapper()
})
describe('navigation Navbar (user has no elopage account)', () => {
beforeAll(() => {
mocks.$store.state.hasElopage = false
wrapper = Wrapper()
})
it('has eight b-nav-item in the navbar', () => {
expect(wrapper.findAll('.nav-item')).toHaveLength(8)
})
it('has first nav-item "navigation.admin_area" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.admin_area')
})
it('has first nav-item "navigation.logout" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.logout')
})
it('has eight b-nav-item in the navbar', () => {
expect(wrapper.findAll('.nav-item')).toHaveLength(8)
})
describe('navigation Navbar (user has no elopage account)', () => {
beforeAll(() => {
mocks.$store.state.hasElopage = false
wrapper = Wrapper()
})
it('has first nav-item "navigation.admin_area" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.admin_area')
})
it('has eight b-nav-item in the navbar', () => {
expect(wrapper.findAll('.nav-item')).toHaveLength(8)
})
it('has first nav-item "navigation.logout" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.logout')
})
})
it('has first nav-item "navigation.admin_area" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.admin_area')
})
describe('navigation Navbar (user has no elopage account)', () => {
beforeAll(() => {
mocks.$store.state.hasElopage = false
wrapper = Wrapper()
})
it('has first nav-item "navigation.logout" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.logout')
})
it('has eight b-nav-item in the navbar', () => {
expect(wrapper.findAll('.nav-item')).toHaveLength(8)
})
it('has first nav-item "navigation.admin_area" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.admin_area')
})
it('has first nav-item "navigation.logout" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.logout')
})
})
})

View File

@ -127,90 +127,94 @@ describe('router', () => {
it('loads the "InfoStatistic" page', async () => {
const component = await routes.find((r) => r.path === '/info').component()
expect(component.default.name).toBe('InfoStatistic')
describe('gdt', () => {
it('requires authorization', () => {
expect(routes.find((r) => r.path === '/gdt').meta.requiresAuth).toBeTruthy()
})
it('loads the "GDT" page', async () => {
const component = await routes.find((r) => r.path === '/gdt').component()
expect(component.default.name).toBe('Transactions')
})
})
describe('gdt', () => {
it('requires authorization', () => {
expect(routes.find((r) => r.path === '/gdt').meta.requiresAuth).toBeTruthy()
})
describe('login', () => {
it('loads the "Login" page', async () => {
const component = await routes.find((r) => r.path === '/login/:code?').component()
expect(component.default.name).toBe('Login')
})
})
it('loads the "GDT" page', async () => {
const component = await routes.find((r) => r.path === '/gdt').component()
expect(component.default.name).toBe('Transactions')
})
})
describe('register', () => {
it('loads the "register" page', async () => {
const component = await routes.find((r) => r.path === '/register/:code?').component()
expect(component.default.name).toBe('Register')
})
})
describe('login', () => {
it('loads the "Login" page', async () => {
const component = await routes.find((r) => r.path === '/login/:code?').component()
expect(component.default.name).toBe('Login')
})
})
describe('forgot password', () => {
it('loads the "ForgotPassword" page', async () => {
const component = await routes.find((r) => r.path === '/forgot-password').component()
expect(component.default.name).toBe('ForgotPassword')
})
})
describe('register', () => {
it('loads the "register" page', async () => {
const component = await routes.find((r) => r.path === '/register/:code?').component()
expect(component.default.name).toBe('Register')
})
})
describe('password with param comingFrom', () => {
it('loads the "ForgotPassword" page', async () => {
const component = await routes
.find((r) => r.path === '/forgot-password/:comingFrom')
.component()
expect(component.default.name).toBe('ForgotPassword')
})
})
describe('forgot password', () => {
it('loads the "ForgotPassword" page', async () => {
const component = await routes.find((r) => r.path === '/forgot-password').component()
expect(component.default.name).toBe('ForgotPassword')
})
})
describe('register-community', () => {
it('loads the "registerCommunity" page', async () => {
const component = await routes.find((r) => r.path === '/register-community').component()
expect(component.default.name).toBe('RegisterCommunity')
})
})
describe('password with param comingFrom', () => {
it('loads the "ForgotPassword" page', async () => {
const component = await routes
.find((r) => r.path === '/forgot-password/:comingFrom')
.component()
expect(component.default.name).toBe('ForgotPassword')
})
})
describe('select-community', () => {
it('loads the "SelectCommunity" page', async () => {
const component = await routes.find((r) => r.path === '/select-community').component()
expect(component.default.name).toBe('SelectCommunity')
})
})
describe('register-community', () => {
it('loads the "registerCommunity" page', async () => {
const component = await routes
.find((r) => r.path === '/register-community')
.component()
expect(component.default.name).toBe('RegisterCommunity')
})
})
describe('reset password', () => {
it('loads the "ResetPassword" page', async () => {
const component = await routes
.find((r) => r.path === '/reset-password/:optin')
.component()
expect(component.default.name).toBe('ResetPassword')
})
})
describe('select-community', () => {
it('loads the "SelectCommunity" page', async () => {
const component = await routes.find((r) => r.path === '/select-community').component()
expect(component.default.name).toBe('SelectCommunity')
})
})
describe('checkEmail', () => {
it('loads the "CheckEmail" page', async () => {
const component = await routes
.find((r) => r.path === '/checkEmail/:optin/:code?')
.component()
expect(component.default.name).toBe('ResetPassword')
})
})
describe('reset password', () => {
it('loads the "ResetPassword" page', async () => {
const component = await routes
.find((r) => r.path === '/reset-password/:optin')
.component()
expect(component.default.name).toBe('ResetPassword')
})
})
describe('redeem', () => {
it('loads the "TransactionLink" page', async () => {
const component = await routes.find((r) => r.path === '/redeem/:code').component()
expect(component.default.name).toBe('TransactionLink')
})
})
describe('checkEmail', () => {
it('loads the "CheckEmail" page', async () => {
const component = await routes
.find((r) => r.path === '/checkEmail/:optin/:code?')
.component()
expect(component.default.name).toBe('ResetPassword')
})
})
describe('not found page', () => {
it('renders the "NotFound" page', async () => {
expect(routes.find((r) => r.path === '*').component).toEqual(NotFound)
describe('redeem', () => {
it('loads the "TransactionLink" page', async () => {
const component = await routes.find((r) => r.path === '/redeem/:code').component()
expect(component.default.name).toBe('TransactionLink')
})
})
describe('not found page', () => {
it('renders the "NotFound" page', async () => {
expect(routes.find((r) => r.path === '*').component).toEqual(NotFound)
})
})
})
})
})