forked from surrealdb/ascua
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
151 additions
and
18 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
22 changes: 22 additions & 0 deletions
22
packages/surrealdb/tests/unit/decorators/authenticated-test.js
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,22 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
import authenticated from '@ascua/surrealdb/decorators/authenticated'; | ||
|
||
module('Unit | Decorators | Authenticated', function (hooks) { | ||
setupTest(hooks); | ||
|
||
class MyClass {} | ||
|
||
test('should only be applied to a Route class', function (assert) { | ||
assert.expect(1); | ||
try { | ||
authenticated(MyClass); | ||
} catch (e) { | ||
assert.equal( | ||
e.message, | ||
'Assertion Failed: The @authenticated decorator can only be applied to a Route' | ||
); | ||
} | ||
}); | ||
}); |
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,22 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
import autosave from '@ascua/surrealdb/decorators/autosave'; | ||
|
||
module('Unit | Decorators | Autosave', function (hooks) { | ||
setupTest(hooks); | ||
|
||
class MyClass {} | ||
|
||
test('should only be applied to a Route class', function (assert) { | ||
assert.expect(1); | ||
try { | ||
autosave(MyClass); | ||
} catch (e) { | ||
assert.equal( | ||
e.message, | ||
'Assertion Failed: The @autosave decorator can only be applied to a Model' | ||
); | ||
} | ||
}); | ||
}); |
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,22 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
import closed from '@ascua/surrealdb/decorators/closed'; | ||
|
||
module('Unit | Decorators | Closed', function (hooks) { | ||
setupTest(hooks); | ||
|
||
class MyClass {} | ||
|
||
test('should only be applied to a Route class', function (assert) { | ||
assert.expect(1); | ||
try { | ||
closed(MyClass); | ||
} catch (e) { | ||
assert.equal( | ||
e.message, | ||
'Assertion Failed: The @closed decorator can only be applied to a Route' | ||
); | ||
} | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
packages/surrealdb/tests/unit/decorators/invalidated-test.js
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,22 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
import invalidated from '@ascua/surrealdb/decorators/invalidated'; | ||
|
||
module('Unit | Decorators | Invalidated', function (hooks) { | ||
setupTest(hooks); | ||
|
||
class MyClass {} | ||
|
||
test('should only be applied to a Route class', function (assert) { | ||
assert.expect(1); | ||
try { | ||
invalidated(MyClass); | ||
} catch (e) { | ||
assert.equal( | ||
e.message, | ||
'Assertion Failed: The @invalidated decorator can only be applied to a Route' | ||
); | ||
} | ||
}); | ||
}); |
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,22 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
import opened from '@ascua/surrealdb/decorators/opened'; | ||
|
||
module('Unit | Decorators | Opened', function (hooks) { | ||
setupTest(hooks); | ||
|
||
class MyClass {} | ||
|
||
test('should only be applied to a Route class', function (assert) { | ||
assert.expect(1); | ||
try { | ||
opened(MyClass); | ||
} catch (e) { | ||
assert.equal( | ||
e.message, | ||
'Assertion Failed: The @opened decorator can only be applied to a Route' | ||
); | ||
} | ||
}); | ||
}); |
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,22 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
import signout from '@ascua/surrealdb/decorators/signout'; | ||
|
||
module('Unit | Decorators | Signout', function (hooks) { | ||
setupTest(hooks); | ||
|
||
class MyClass {} | ||
|
||
test('should only be applied to a Route class', function (assert) { | ||
assert.expect(1); | ||
try { | ||
signout(MyClass); | ||
} catch (e) { | ||
assert.equal( | ||
e.message, | ||
'Assertion Failed: The @signout decorator can only be applied to a Route' | ||
); | ||
} | ||
}); | ||
}); |
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