Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes match operator to fix test flakiness #1594

Merged
merged 1 commit into from
Oct 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -55,7 +55,7 @@ describe('AmountDisplay.vue', () => {
describe('Common case', () => {
test('displays amount converted to selected fiat currency', async () => {
wrapper = createWrapper(bigNumberify(1.20440001), Zero, 'USD');
expect(wrapper.find('.amount-display__value').text()).toMatch('1.44');
expect(wrapper.find('.amount-display__value').text()).toBe('1.44');
expect(wrapper.find('.amount-display__full-value').exists()).toBe(false);
});

Expand All @@ -65,14 +65,14 @@ describe('AmountDisplay.vue', () => {
bigNumberify(1.20440001),
'EUR'
);
expect(wrapper.find('.amount-display__value').text()).toMatch('1.20');
expect(wrapper.find('.amount-display__value').text()).toBe('1.20');
expect(wrapper.find('.amount-display__full-value').exists()).toBe(false);
});

test('displays amount as it is without fiat conversion', async () => {
wrapper = createWrapper(bigNumberify(1.20540001), Zero, null);
expect(wrapper.find('.amount-display__value').text()).toMatch('1.21');
expect(wrapper.find('.amount-display__full-value').text()).toMatch(
expect(wrapper.find('.amount-display__value').text()).toBe('1.21');
expect(wrapper.find('.amount-display__full-value').text()).toBe(
'1.20540001'
);
});
Expand All @@ -85,7 +85,7 @@ describe('AmountDisplay.vue', () => {

test('displays amount converted to selected fiat currency as scrambled', async () => {
wrapper = createWrapper(bigNumberify(1.20440001), Zero, 'USD');
expect(wrapper.find('.amount-display__value').text()).not.toMatch('1.44');
expect(wrapper.find('.amount-display__value').text()).not.toBe('1.44');
expect(wrapper.find('.amount-display__full-value').exists()).toBe(false);
});

Expand All @@ -95,14 +95,14 @@ describe('AmountDisplay.vue', () => {
bigNumberify(1.20440001),
'EUR'
);
expect(wrapper.find('.amount-display__value').text()).not.toMatch('1.20');
expect(wrapper.find('.amount-display__value').text()).not.toBe('1.20');
expect(wrapper.find('.amount-display__full-value').exists()).toBe(false);
});

test('displays amount as it is without fiat conversion as scrambled', async () => {
wrapper = createWrapper(bigNumberify(1.20540001), Zero, null);
expect(wrapper.find('.amount-display__value').text()).not.toMatch('1.21');
expect(wrapper.find('.amount-display__full-value').text()).not.toMatch(
expect(wrapper.find('.amount-display__value').text()).not.toBe('1.21');
expect(wrapper.find('.amount-display__full-value').text()).not.toBe(
'1.20540001'
);
});
Expand Down