Skip to content

Commit

Permalink
wip: rough in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyguenther committed Mar 2, 2024
1 parent 05e36ec commit da5e0c7
Show file tree
Hide file tree
Showing 13 changed files with 160 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/commands/theme/settings/download.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {describe, expect, test, vi} from 'vitest'

describe('download', () => {
describe('run', () => {
test('call cli2 command', () => {})
})
})
6 changes: 6 additions & 0 deletions src/services/bucket/create.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {describe, expect, test, vi} from 'vitest'

describe('create', () => {
test.fails('creates bucket and shows message', () => {})
test.fails('creates mulitple buckets and shows message', () => {})
})
6 changes: 6 additions & 0 deletions src/services/bucket/current.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {describe, expect, test, vi} from 'vitest'

describe('current', () => {
test.fails('gets current bucket with 0.x current file', () => {})
test.fails('gets current bucket with 1.x current file', () => {})
})
11 changes: 11 additions & 0 deletions src/services/bucket/delete.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {describe, expect, test, vi} from 'vitest'

describe('delete', () => {
describe('when forced', () => {
test.fails('deletes files without confirmation', () => {})
})
describe('when asked for confirmation', () => {
test.fails('deletes files after receiving confirmation', () => {})
test.fails('does not delete files after being denied confirmation', () => {})
})
})
20 changes: 20 additions & 0 deletions src/services/bucket/init.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {describe, expect, test, vi} from 'vitest'

describe('init', () => {
describe('init', () => {
describe('when .gitignore exists', () => {
test.fails('creates buckets and updates .gitignore', () => {})
})
describe('when .gitignore does not exist', () => {
test.fails('creates buckets and creates .gitignore', () => {})
})
})
describe('renderBucketListSection', () => {
describe('when array of buckets provided', () => {
test.fails('returns a bucket list section', () => {})
})
describe('when no buckets provided', () => {
test.fails('returns an empty selection list', () => {})
})
})
})
5 changes: 5 additions & 0 deletions src/services/bucket/list.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {describe, expect, test, vi} from 'vitest'

describe('list', () => {
test.fails('renders a table of buckets', () => {})
})
10 changes: 10 additions & 0 deletions src/services/bucket/restore.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {describe, expect, test, vi} from 'vitest'

describe('restore', () => {
describe('when file removal skipped', () => {
test.fails('copies files from bucket into theme', () => {})
})
describe('when files removed on restore', () => {
test.fails('copies files from bucket into theme', () => {})
})
})
10 changes: 10 additions & 0 deletions src/services/bucket/save.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {describe, expect, test, vi} from 'vitest'

describe('save', () => {
describe('when file removal skipped', () => {
test.fails('copies files from theme into bucket', () => {})
})
describe('when files removed on restore', () => {
test.fails('copies files from theme into bucket', () => {})
})
})
15 changes: 15 additions & 0 deletions src/services/bucket/switch.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {describe, expect, test, vi} from 'vitest'

describe('switch', () => {
describe('switchBucket', () => {
describe('when file removal skipped', () => {
test.fails('copies files from bucket into theme', () => {})
})
describe('when files removed on restore', () => {
test.fails('copies files from bucket into theme', () => {})
})
})
describe('appendEnv', () => {
test.fails('appends file move to move .env', () => {})
})
})
42 changes: 42 additions & 0 deletions src/services/theme/deploy.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import {describe, expect, test, vi} from 'vitest'

describe('deploy', () => {
describe('deploy', () => {
describe('when blue/green strategy', () => {
test.fails('makes blue/green deploy', () => {})
})
describe('when no strategy is passsed', () => {
test.fails('makes basic deploy', () => {})
})
})

describe('blueGreenDeploy', () => {
test.fails('pulls live theme settings and updates on-deck theme', () => {})
})

describe('basicDeploy', () => {
test.fails('pulls live theme settings and updates theme', () => {})
})

describe('getLiveTheme', () => {
describe('when live theme exists', () => {
test.fails('returns live theme id', () => {})
})
describe('when live theme does not exist', () => {
test.fails('throws abort error', () => {})
})
})

describe('getOnDeckThemeId', () => {
describe('when published theme is blue', () => {
test('returns green', () => {})
})
describe('when published theme is green', () => {
test('returns blue', () => {})
})
})

describe('gitHeadHash', () => {
test('returns the first 8 chars', () => {})
})
})
5 changes: 5 additions & 0 deletions src/services/theme/get.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {describe, expect, test, vi} from 'vitest'

describe('get', () => {
test.fails('returns theme', () => {})
})
2 changes: 1 addition & 1 deletion src/utilities/bucket.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {renderSelectPrompt} from '@shopify/cli-kit/node/ui'

vi.mock('@shopify/cli-kit/node/ui')

describe('bucket', () => {
describe('bucket utilities', () => {
describe('createBuckets', async () => {
test('creates a bucket', async () => {
await inTemporaryDirectory(async (tmpDir: string) => {
Expand Down
22 changes: 22 additions & 0 deletions src/utilities/theme.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {describe, expect, test, vi} from 'vitest'

describe('theme utilities', () => {
describe('pullThemeSettings', () => {
test.fails('pulls settings from live theme', () => {})
})
describe('push', () => {
test.fails('pushes theme files to theme', () => {})
})
describe('pushToLive', () => {
test.fails('pushes theme files to live theme', () => {})
})
describe('getThemesByIdentifier', () => {
test.fails('returns list of themes that match id or name', () => {})
})
describe('filterByTheme', () => {
test.fails('returns list of themes that match filter', () => {})
})
describe('filterArray', () => {
test.fails('returns list of themes that match predicate', () => {})
})
})

0 comments on commit da5e0c7

Please sign in to comment.