BigW Consortium Gitlab

Commit 705a840d by Tim Zallmann

Not the Test will also work with other tests before

parent 0647484c
...@@ -257,7 +257,7 @@ const RepoHelper = { ...@@ -257,7 +257,7 @@ const RepoHelper = {
history.pushState({ key: RepoHelper.key }, '', url); history.pushState({ key: RepoHelper.key }, '', url);
if (title) { if (title) {
document.title = `${title}`; document.title = title;
} }
}, },
......
...@@ -14,7 +14,7 @@ describe('RepoFile', () => { ...@@ -14,7 +14,7 @@ describe('RepoFile', () => {
level: 10, level: 10,
}; };
const activeFile = { const activeFile = {
url: 'url', url: 'activeUrl',
pageTitle: 'pageTitle', pageTitle: 'pageTitle',
}; };
...@@ -31,11 +31,11 @@ describe('RepoFile', () => { ...@@ -31,11 +31,11 @@ describe('RepoFile', () => {
}); });
it('renders link, icon, name and last commit details', () => { it('renders link, icon, name and last commit details', () => {
RepoStore.setActiveFiles(activeFile);
const vm = createComponent({ const vm = createComponent({
file, file,
activeFile, activeFile,
}); });
RepoStore.setActiveFiles(activeFile);
const name = vm.$el.querySelector('.repo-file-name'); const name = vm.$el.querySelector('.repo-file-name');
const fileIcon = vm.$el.querySelector('.file-icon'); const fileIcon = vm.$el.querySelector('.file-icon');
...@@ -44,7 +44,7 @@ describe('RepoFile', () => { ...@@ -44,7 +44,7 @@ describe('RepoFile', () => {
expect(name.title).toEqual(file.url); expect(name.title).toEqual(file.url);
expect(name.href).toMatch(`/${file.url}`); expect(name.href).toMatch(`/${file.url}`);
expect(name.textContent.trim()).toEqual(file.name); expect(name.textContent.trim()).toEqual(file.name);
expect(document.title.trim()).toEqual(file.pageTitle); expect(document.title.trim()).toEqual(activeFile.pageTitle);
expect(vm.$el.querySelector('.commit-message').textContent.trim()).toBe(file.lastCommitMessage); expect(vm.$el.querySelector('.commit-message').textContent.trim()).toBe(file.lastCommitMessage);
expect(vm.$el.querySelector('.commit-update').textContent.trim()).toBe(updated); expect(vm.$el.querySelector('.commit-update').textContent.trim()).toBe(updated);
expect(fileIcon.classList.contains(file.icon)).toBeTruthy(); expect(fileIcon.classList.contains(file.icon)).toBeTruthy();
......
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