Commit b59ce918 authored by Thomas Randolph's avatar Thomas Randolph

Update tests for modified UI text and buttons

parent f05696dc
......@@ -17,11 +17,11 @@ RSpec.describe 'User expands diff', :js do
it 'allows user to expand diff' do
page.within find('[id="19763941ab80e8c09871c0a425f0560d9053bcb3"]') do
click_link 'Click to expand it.'
find('[data-testid="expandButton"]').click
wait_for_requests
expect(page).not_to have_content('Click to expand it.')
expect(page).not_to have_content('Expand File')
expect(page).to have_selector('.code')
end
end
......
......@@ -90,8 +90,8 @@ describe('DiffFile', () => {
vm.isCollapsed = true;
vm.$nextTick(() => {
expect(vm.$el.innerText).toContain('This diff is collapsed');
expect(vm.$el.querySelectorAll('.js-click-to-expand').length).toEqual(1);
expect(vm.$el.innerText).toContain('This file is collapsed.');
expect(vm.$el.querySelector('[data-testid="expandButton"]')).not.toBeFalsy();
done();
});
......@@ -102,8 +102,8 @@ describe('DiffFile', () => {
vm.isCollapsed = true;
vm.$nextTick(() => {
expect(vm.$el.innerText).toContain('This diff is collapsed');
expect(vm.$el.querySelectorAll('.js-click-to-expand').length).toEqual(1);
expect(vm.$el.innerText).toContain('This file is collapsed.');
expect(vm.$el.querySelector('[data-testid="expandButton"]')).not.toBeFalsy();
done();
});
......@@ -121,8 +121,8 @@ describe('DiffFile', () => {
vm.isCollapsed = true;
vm.$nextTick(() => {
expect(vm.$el.innerText).toContain('This diff is collapsed');
expect(vm.$el.querySelectorAll('.js-click-to-expand').length).toEqual(1);
expect(vm.$el.innerText).toContain('This file is collapsed.');
expect(vm.$el.querySelector('[data-testid="expandButton"]')).not.toBeFalsy();
done();
});
......@@ -135,7 +135,7 @@ describe('DiffFile', () => {
vm.file.viewer.name = diffViewerModes.renamed;
vm.$nextTick(() => {
expect(vm.$el.innerText).not.toContain('This diff is collapsed');
expect(vm.$el.innerText).not.toContain('This file is collapsed.');
done();
});
......@@ -148,7 +148,7 @@ describe('DiffFile', () => {
vm.file.viewer.name = diffViewerModes.mode_changed;
vm.$nextTick(() => {
expect(vm.$el.innerText).not.toContain('This diff is collapsed');
expect(vm.$el.innerText).not.toContain('This file is collapsed.');
done();
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment