-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #510 from Duke-MatSci/resolve_ns
Resolve Namespace - Pt1
- Loading branch information
Showing
13 changed files
with
737 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<template> | ||
<div class="section_pages"> | ||
<div v-if="!loading && !namespace" class="wrapper"> | ||
<h1 class="visualize_header-h1 article_title"> | ||
MaterialsMine Namespace Center | ||
</h1> | ||
<div class="article_subtitle">Welcome...</div> | ||
</div> | ||
<div v-else-if="!loading && namespace" class="wrapper"> | ||
<h1 class="visualize_header-h1 article_title">{{ namespace }}</h1> | ||
<div class="article_subtitle">Additional information comming soon...</div> | ||
</div> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
name: 'Namespace', | ||
data () { | ||
return { | ||
loading: false | ||
} | ||
}, | ||
computed: { | ||
namespace () { | ||
return this.$route.params?.namespace | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const nsRoutes = [ | ||
{ | ||
path: '', | ||
name: 'Namespace', | ||
component: () => import('@/pages/ns/Home.vue'), | ||
meta: { requiresAuth: false } | ||
}, | ||
{ | ||
path: ':namespace', | ||
name: 'Namespaces', | ||
component: () => import('@/pages/ns/Home.vue'), | ||
meta: { requiresAuth: false } | ||
} | ||
] | ||
|
||
export default nsRoutes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,11 @@ const chai = require('chai'); | |
const sinon = require('sinon'); | ||
const Contact = require('../../../src/models/contact'); | ||
const graphQlSchema = require('../../../src/graphql'); | ||
const { | ||
mockContact, | ||
mockUserContact, | ||
mockUpdatedContact | ||
} = require('../../mocks'); | ||
const { | ||
Mutation: { submitContact, updateContact }, | ||
Query: { getUserContacts, contacts } | ||
|
@@ -11,23 +16,6 @@ const FileController = require('../../../src/controllers/fileController'); | |
|
||
const { expect } = chai; | ||
|
||
const mockContact = { | ||
fullName: 'test user', | ||
email: '[email protected]', | ||
purpose: 'QUESTION', | ||
message: 'test message', | ||
attachments: [ | ||
'/api/files/strategic_beetle_joelle-2024-02-15T09:25:42.264Z-master_template (5).xlsx?isStore=true', | ||
'/api/files/strategic_beetle_joelle-2024-02-15T09:27:07.905Z-master_template.xlsx?isStore=true' | ||
] | ||
}; | ||
|
||
const mockUpdatedContact = { | ||
...mockContact, | ||
resolved: true, | ||
response: 'Thanks for reaching out. We are working on it' | ||
}; | ||
|
||
describe('Contact Resolver Unit Tests:', function () { | ||
afterEach(() => sinon.restore()); | ||
|
||
|
@@ -124,15 +112,6 @@ describe('Contact Resolver Unit Tests:', function () { | |
}); | ||
|
||
context('getUserContacts', () => { | ||
const mockUserContact = { | ||
_id: 'akdn9wqkn', | ||
fullName: 'test user', | ||
email: '[email protected]', | ||
purpose: 'QUESTION', | ||
message: 'test message', | ||
lean: () => this | ||
}; | ||
|
||
it("should return paginated lists of a user's contacts", async () => { | ||
sinon.stub(Contact, 'countDocuments').returns(1); | ||
sinon.stub(Contact, 'find').returns(mockUserContact); | ||
|
Oops, something went wrong.