From 35f9c4a5b4d3633f4c9cbf33fbf87e407eabaa63 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 11 May 2021 18:58:12 +0200 Subject: [PATCH] test that em-dash is shown while balance is loading --- .../Pages/AccountOverview/GddStatus.spec.js | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/Pages/AccountOverview/GddStatus.spec.js b/frontend/src/views/Pages/AccountOverview/GddStatus.spec.js index 9adc3b4ca..b414f4e93 100644 --- a/frontend/src/views/Pages/AccountOverview/GddStatus.spec.js +++ b/frontend/src/views/Pages/AccountOverview/GddStatus.spec.js @@ -24,12 +24,30 @@ describe('GddStatus', () => { wrapper = Wrapper() }) - it('it displays the ammount of GDD', () => { - expect(wrapper.findAll('div.card-body').at(0).text()).toEqual('1234 GDD') + describe('balance is loading', () => { + it('it displays em-dash as the ammount of GDD', () => { + expect(wrapper.findAll('div.card-body').at(0).text()).toEqual('— GDD') + }) + + it('it displays em-dash as the ammount of GDT', () => { + expect(wrapper.findAll('div.card-body').at(1).text()).toEqual('— GDT') + }) }) - it('it displays the ammount of GDT', () => { - expect(wrapper.findAll('div.card-body').at(1).text()).toEqual('9876 GDT') + describe('balance is loaded', () => { + beforeEach(() => { + wrapper.setProps({ + pending: false, + }) + }) + + it('it displays the ammount of GDD', () => { + expect(wrapper.findAll('div.card-body').at(0).text()).toEqual('1234 GDD') + }) + + it('it displays the ammount of GDT', () => { + expect(wrapper.findAll('div.card-body').at(1).text()).toEqual('9876 GDT') + }) }) }) })