-
Notifications
You must be signed in to change notification settings - Fork 61
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 #167 from ensdomains/mdt/os-api-config
add os api config, update csp, minor improvements
- Loading branch information
Showing
14 changed files
with
140 additions
and
66 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
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
Binary file not shown.
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
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,28 @@ | ||
import avaTest, { ExecutionContext, TestFn } from 'ava'; | ||
import { TestContext } from '../../mock/interface'; | ||
import { Metadata } from './metadata'; | ||
import { Version } from '../base'; | ||
|
||
const test = avaTest as TestFn<TestContext>; | ||
|
||
test('should compute metadata correctly', async (t: ExecutionContext<TestContext>) => { | ||
const nickMetadataObj = { | ||
name: 'nick.eth', | ||
description: 'nick.eth, an ENS name.', | ||
created_date: 1571924851000, | ||
tokenId: '0x5d5727cb0fb76e4944eafb88ec9a3cf0b3c9025a4b2f947729137c5d7f84f68f', | ||
version: Version.v1, | ||
last_request_date: Date.now() | ||
}; | ||
const testMetadata = new Metadata(nickMetadataObj); | ||
|
||
t.is(testMetadata.name, nickMetadataObj.name); | ||
t.is(testMetadata.description, nickMetadataObj.description); | ||
t.is(testMetadata.attributes[0].value, nickMetadataObj.created_date * 1000); | ||
t.is(testMetadata.version, Version.v1); | ||
}); | ||
|
||
test('should return correct font size', async (t: ExecutionContext<TestContext>) => { | ||
const textSize = Metadata._getFontSize('nick.eth'); | ||
t.is(textSize, 32); | ||
}); |
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
Oops, something went wrong.