summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-10-06 22:56:09 +0300
committerFatih Acet <acetfatih@gmail.com>2017-10-06 22:56:09 +0300
commitff5886c34cc1a14b5aeed22f13133456a418da64 (patch)
tree042072f7c623db2c975c444ced11ff924c6bb5ab
parent5daa8fbc29ee2fc309602d24167a401563bc3b2c (diff)
downloadgitlab-ce-ff5886c34cc1a14b5aeed22f13133456a418da64.tar.gz
Fix karma specs and scss linter.
-rw-r--r--app/assets/stylesheets/pages/repo.scss4
-rw-r--r--spec/javascripts/repo/services/repo_service_spec.js64
2 files changed, 4 insertions, 64 deletions
diff --git a/app/assets/stylesheets/pages/repo.scss b/app/assets/stylesheets/pages/repo.scss
index fdef18ef071..826c512030f 100644
--- a/app/assets/stylesheets/pages/repo.scss
+++ b/app/assets/stylesheets/pages/repo.scss
@@ -68,10 +68,10 @@
}
.panel-right {
+ @include editor-height(0);
display: flex;
flex-direction: column;
width: 80%;
- @include editor-height(0);
.monaco-editor.vs {
.current-line {
@@ -278,8 +278,8 @@
}
#sidebar {
- flex: 1;
@include editor-height(0);
+ flex: 1;
&.sidebar-mini {
width: 20%;
diff --git a/spec/javascripts/repo/services/repo_service_spec.js b/spec/javascripts/repo/services/repo_service_spec.js
index 6f530770525..25034c3fa37 100644
--- a/spec/javascripts/repo/services/repo_service_spec.js
+++ b/spec/javascripts/repo/services/repo_service_spec.js
@@ -8,78 +8,18 @@ describe('RepoService', () => {
expect(RepoService.options.params.format).toBe('json');
});
- describe('buildParams', () => {
- let newParams;
- const url = 'url';
-
- beforeEach(() => {
- newParams = {};
-
- spyOn(Object, 'assign').and.returnValue(newParams);
- });
-
- it('clones params', () => {
- const params = RepoService.buildParams(url);
-
- expect(Object.assign).toHaveBeenCalledWith({}, RepoService.options.params);
-
- expect(params).toBe(newParams);
- });
-
- it('sets and returns viewer params to richif urlIsRichBlob is true', () => {
- spyOn(RepoService, 'urlIsRichBlob').and.returnValue(true);
-
- const params = RepoService.buildParams(url);
-
- expect(params.viewer).toEqual('rich');
- });
-
- it('returns params urlIsRichBlob is false', () => {
- spyOn(RepoService, 'urlIsRichBlob').and.returnValue(false);
-
- const params = RepoService.buildParams(url);
-
- expect(params.viewer).toBeUndefined();
- });
-
- it('calls urlIsRichBlob with the objects url prop if no url arg is provided', () => {
- spyOn(RepoService, 'urlIsRichBlob');
- RepoService.url = url;
-
- RepoService.buildParams();
-
- expect(RepoService.urlIsRichBlob).toHaveBeenCalledWith(url);
- });
- });
-
- describe('urlIsRichBlob', () => {
- it('returns true for md extension', () => {
- const isRichBlob = RepoService.urlIsRichBlob('url.md');
-
- expect(isRichBlob).toBeTruthy();
- });
-
- it('returns false for js extension', () => {
- const isRichBlob = RepoService.urlIsRichBlob('url.js');
-
- expect(isRichBlob).toBeFalsy();
- });
- });
-
describe('getContent', () => {
- const params = {};
+ const params = { format: 'json' };
const url = 'url';
const requestPromise = Promise.resolve();
beforeEach(() => {
- spyOn(RepoService, 'buildParams').and.returnValue(params);
spyOn(axios, 'get').and.returnValue(requestPromise);
});
- it('calls buildParams and axios.get', () => {
+ it('axios.get', () => {
const request = RepoService.getContent(url);
- expect(RepoService.buildParams).toHaveBeenCalledWith(url);
expect(axios.get).toHaveBeenCalledWith(url, {
params,
});