df5a6ebe32
WHAT: Navigation sidebar reworked. Project dropdown moved back to header, resources and settings sections moved to header as dropdowns. Header reworked to match new design. WHY: GUI redesign Change-Id: I73e1269326d3dbfba2e44d848dba4a415e64e539
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
// Copyright (C) 2020 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
import Vuex from 'vuex';
|
|
|
|
import ProjectDropdown from '@/components/header/projectsDropdown/ProjectDropdown.vue';
|
|
|
|
import { appStateModule } from '@/store/modules/appState';
|
|
import { makeProjectsModule, PROJECTS_MUTATIONS } from '@/store/modules/projects';
|
|
import { Project } from '@/types/projects';
|
|
import { createLocalVue, shallowMount } from '@vue/test-utils';
|
|
|
|
import { ProjectsApiMock } from '../mock/api/projects';
|
|
|
|
const localVue = createLocalVue();
|
|
localVue.use(Vuex);
|
|
|
|
const projectsApi = new ProjectsApiMock();
|
|
const projectsModule = makeProjectsModule(projectsApi);
|
|
const project1 = new Project('testId1', 'testName1', '');
|
|
const project2 = new Project('testId2', 'testName2', '');
|
|
|
|
const store = new Vuex.Store({ modules: { projectsModule, appStateModule }});
|
|
|
|
describe('ProjectDropdown', () => {
|
|
it('renders correctly', () => {
|
|
store.commit(PROJECTS_MUTATIONS.SET_PROJECTS, [project1, project2]);
|
|
store.commit(PROJECTS_MUTATIONS.SELECT_PROJECT, project1.id);
|
|
|
|
const wrapper = shallowMount(ProjectDropdown, {
|
|
store,
|
|
localVue,
|
|
});
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
});
|