diff --git a/frontend/src/views/Pages/Login.vue b/frontend/src/views/Pages/Login.vue index 5d1072d45..e5b365d75 100755 --- a/frontend/src/views/Pages/Login.vue +++ b/frontend/src/views/Pages/Login.vue @@ -88,6 +88,7 @@ export default { email: this.form.email, password: this.form.password, }, + fetchPolicy: 'network-only', }) .then((result) => { const { diff --git a/frontend/src/views/Pages/UserProfileTransactionList.spec.js b/frontend/src/views/Pages/UserProfileTransactionList.spec.js index 93a5eb40f..484dd10f1 100644 --- a/frontend/src/views/Pages/UserProfileTransactionList.spec.js +++ b/frontend/src/views/Pages/UserProfileTransactionList.spec.js @@ -3,16 +3,6 @@ import UserProfileTransactionList from './UserProfileTransactionList' const localVue = global.localVue -const mutationObserverMock = jest.fn(function MutationObserver(callback) { - this.observe = jest.fn() - this.disconnect = jest.fn() - this.trigger = (mockedMutationsList) => { - callback(mockedMutationsList, this) - } -}) - -global.MutationObserver = mutationObserverMock - describe('UserProfileTransactionList', () => { let wrapper @@ -33,7 +23,7 @@ describe('UserProfileTransactionList', () => { const stubs = { GdtTransactionList: true, } - + const Wrapper = () => { return mount(UserProfileTransactionList, { localVue, mocks, stubs }) } @@ -65,5 +55,43 @@ describe('UserProfileTransactionList', () => { it('renders the transaction gradido transform table', () => { expect(wrapper.findComponent({ name: 'GdtTransactionList' }).exists()).toBeTruthy() }) + + describe('tabs', () => { + it('shows the GDD transactions by default', () => { + expect(wrapper.findAll('div[role="tabpanel"]').at(0).isVisible()).toBeTruthy() + }) + + it('does not show the GDT transactions by default', () => { + expect(wrapper.findAll('div[role="tabpanel"]').at(1).isVisible()).toBeFalsy() + }) + + describe('click on GDT tab', () => { + beforeEach(() => { + wrapper.findAll('li[ role="presentation"]').at(1).find('a').trigger('click') + }) + + it('does not show the GDD transactions', () => { + expect(wrapper.findAll('div[role="tabpanel"]').at(0).isVisible()).toBeFalsy() + }) + + it('shows the GDT transactions', () => { + expect(wrapper.findAll('div[role="tabpanel"]').at(1).isVisible()).toBeTruthy() + }) + + describe('click on GDD tab', () => { + beforeEach(() => { + wrapper.findAll('li[ role="presentation"]').at(0).find('a').trigger('click') + }) + + it('shows the GDD transactions', () => { + expect(wrapper.findAll('div[role="tabpanel"]').at(0).isVisible()).toBeTruthy() + }) + + it('does not show the GDT', () => { + expect(wrapper.findAll('div[role="tabpanel"]').at(1).isVisible()).toBeFalsy() + }) + }) + }) + }) }) }) diff --git a/frontend/test/testSetup.js b/frontend/test/testSetup.js index 565ebc33f..7005ff5be 100644 --- a/frontend/test/testSetup.js +++ b/frontend/test/testSetup.js @@ -33,6 +33,9 @@ loadAllRules(i18nMock) global.localVue = createLocalVue() +// switch of warnings from bootstrap vue +global.process.env.BOOTSTRAP_VUE_NO_WARN = true + global.localVue.use(BootstrapVue) global.localVue.use(Vuex) global.localVue.use(IconsPlugin) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 1e12bd647..eff78ada1 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -3750,9 +3750,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001181: - version "1.0.30001191" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001191.tgz#bacb432b6701f690c8c5f7c680166b9a9f0843d9" - integrity sha512-xJJqzyd+7GCJXkcoBiQ1GuxEiOBCLQ0aVW9HMekifZsAVGdj5eJ4mFB9fEhSHipq9IOk/QXFJUiIr9lZT+EsGw== + version "1.0.30001251" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz" + integrity sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A== capture-exit@^2.0.0: version "2.0.0"