Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJacques Erasmus <jerasmus@gitlab.com>2020-02-17 10:58:03 +0300
committerMike Greiling <mike@pixelcog.com>2020-02-17 10:58:03 +0300
commitb8383c0176134deb12a3d80ae9e91f524f7fe499 (patch)
treeb20c8bc44d5142c48ee17f8e012ae7b52c38b1be /spec
parent08aea75e33d5fd105106fc825987b171efb69992 (diff)
Remove redirect to archives page
Removed the redirect logic to the archives page
Diffstat (limited to 'spec')
-rw-r--r--spec/frontend/404/components/error_message_spec.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/frontend/404/components/error_message_spec.js b/spec/frontend/404/components/error_message_spec.js
new file mode 100644
index 00000000..f205ce93
--- /dev/null
+++ b/spec/frontend/404/components/error_message_spec.js
@@ -0,0 +1,27 @@
+import { mount } from '@vue/test-utils';
+import ErrorMessage from '../../../../content/frontend/404/components/error_message.vue';
+
+const propsData = { isProduction: true, isOffline: false, archivesPath: '/archives/' };
+
+describe('component: Error Message', () => {
+ let wrapper;
+
+ beforeEach(() => {
+ wrapper = mount(ErrorMessage, { propsData });
+ });
+
+ it('renders a heading with correct text', () => {
+ expect(wrapper.find('h2').exists()).toBe(true);
+ expect(wrapper.find('h2').text()).toEqual("There's no page at this address!");
+ });
+
+ it('does not render an error description if not offline', () => {
+ expect(wrapper.find('.js-error-description').exists()).toBe(false);
+ });
+
+ it('renders an error description if isOffline is true', () => {
+ wrapper = mount(ErrorMessage, { propsData: { ...propsData, isOffline: true } });
+ expect(wrapper.find('.js-error-description').exists()).toBe(true);
+ expect(wrapper.find('.js-error-description a').exists()).toBe(true);
+ });
+});